You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`drawOn()` / `fullDrawOn()` takes context instead of Canvas as first arg
15
+
*`drawNew()` is deprecated => `render()`, also takes context as arg
16
+
* new`rerender()` to earmark for rerendering
17
+
*`.image`accessing has been turned intoa getter method: `getImage()`
18
+
*`.image`property has been deprecated, renamed to `cachedImage`for Morphs that need to check for pixel-wise collision frequently
19
+
* new `isCachingImage` flag (default: false)
20
+
* new `shouldRerender` flag (default: false)
21
+
*`fixLayout()`is now available for all Morphs, determines extent and arranges submorphs, if any, gets called from `setExtent()`
22
22
* new `fixHolesLayout()` method in case your Morphs have untouchable areas ("holes")
23
23
* "silent" - functions are no longer needed, e.g. `silentSetExtent()`, `silentMoveBy()`
24
24
-`silentSetExtent` => use `bounds.setExtent()` to avoid infinite recursion
@@ -37,7 +37,7 @@ The second section is a recipe how to actually migrate your code. It's a list of
37
37
-`new Color()`, `new Color(0, 0, 0)` => `BLACK`
38
38
-`new Color(255, 255, 255)` => `WHITE`
39
39
*`virtualKeyboard` property in Morphic preference has been deprecated
40
-
*`fullImageClassic()` => is now always just `fullImage()`
40
+
*`fullImageClassic()` => is now always just `fullImage()`
41
41
*`keyboardReceiver` => `keyboardFocus`
42
42
* keyboard navigation can be activated for any visible menu by pressing an arbitrary key
43
43
* new `noDropShadow` property for Morphs that already have built-in shadows (Menus, SpeechBubbles)
@@ -47,33 +47,33 @@ The second section is a recipe how to actually migrate your code. It's a list of
47
47
48
48
Search your code for these words and replace them according to the instructions. It's best to follow the order given here. The last 3 replacements with constants are optional optimizations and can be left out.
49
49
50
-
**Words to search your code for**
50
+
**Words to search your code for:**
51
51
52
52
***drawNew**
53
-
- rename method definitions to "render", notice that the first argument needs to be the 2D context, therefore remove the part in the code that makes a new canvas and queries its context.
54
-
- factor out the parts of the code that determine and set the extent and move them into a - possibly new - method named fixLayout()
55
-
- rename function calls to drawNew() to fixLayout() and/or rerender(), check whether the call is at all needed as it might be redundant in the new system
56
-
***wantsRedraw** => replace with rerender()
57
-
***noticesTransparentClick** => replace with => !isFreeForm, use with caution, as free forms should also cache their image for performance reason, which in turn strains memory usage
58
-
***.image** => remove getters to getImage(), use with caution because of performance bottlenecks
53
+
- rename method definitions to `render`, notice that the first argument needs to be the 2D context, therefore remove the part in the code that makes a new canvas and queries its context.
54
+
- factor out the parts of the code that determine and set the extent and move them into a - possibly new - method named `fixLayout()`
55
+
- rename function calls to `drawNew()` to `fixLayout()` and/or `rerender()`, check whether the call is at all needed as it might be redundant in the new system
56
+
***wantsRedraw** => replace with `rerender()`
57
+
***noticesTransparentClick** => replace with `!isFreeForm`, use with caution, as free forms should also cache their image for performance reason, which in turn strains memory usage
58
+
***.image** => rename getters to `getImage()`, use with caution because of performance bottlenecks
59
59
***cachedFullImage** => no longer supported, remove all references
60
-
***fullImageClassic** => rename method calls to just fullImage()
60
+
***fullImageClassic** => rename method calls to just `fullImage()`
61
61
***silentSet**
62
62
- remove method definitions
63
63
- rename method calls:
64
-
- silentSetExtent => use bounds.setExtent() to avoid infinite recursion
65
-
- silentMoveBy => use moveBy()
66
-
- silentSetPosition => use setPosition()
67
-
- silentSetWidth => use bounds.setWidth() to avoid infinite recursion
68
-
- silentSetHeight = use bounds.setHeight() to avoid infinite recursion
69
-
***silentMove** => replace silentMoveBy() with moveBy()
64
+
-*silentSetExtent* => use `bounds.setExtent()` to avoid infinite recursion
65
+
-*silentMoveBy* => use `moveBy()`
66
+
-*silentSetPosition* => use `setPosition()`
67
+
-*silentSetWidth* => use `bounds.setWidth()` to avoid infinite recursion
68
+
-*silentSetHeight* = use `bounds.setHeight()` to avoid infinite recursion
69
+
***silentMove** => replace `silentMoveBy()` with `moveBy()`
70
70
***silentReplace** => (Snap! only) use replace instead
71
71
***silent** => remove parameters named "silent" from function definitions and calls
72
-
***cachedFullBounds** => no longer supported, remove all references
73
-
***trackChanges** => no longer supported, remove all references
74
-
***keyboardReceiver** => rename to keyboardFocus
75
-
***startLayout** => no longer supported, remove all calls
72
+
***cachedFullBounds** => no longer supported, remove all references
73
+
***trackChanges** => no longer supported, remove all references
74
+
***keyboardReceiver** => rename to `keyboardFocus`
75
+
***startLayout** => no longer supported, remove all calls
76
76
***endLayout** => no longer supported, remove all calls
77
-
***new Point(0, 0)** => ZERO, but only if the point is not to be mutated
78
-
***new Color() / new Color(0, 0, 0)** => BLACK, again, only if the color is not to be mutated
79
-
***new Color(255, 255, 255)** => WHITE
77
+
***new Point(0, 0)** => `ZERO`, but only if the point is not to be mutated
78
+
***new Color() / new Color(0, 0, 0)** => `BLACK`, again, only if the color is not to be mutated
0 commit comments