Skip to content

Commit 9ec49ff

Browse files
committed
Update MIGRATING.md
1 parent 61294ec commit 9ec49ff

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

MIGRATING.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ The second section is a recipe how to actually migrate your code. It's a list of
1010

1111
## Morphic Changes
1212

13-
* `noticesTransparentClick` => `!isFreeForm` (reversed default)
14-
* `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()`
13+
* `noticesTransparentClick` => `!isFreeForm` (reversed default)
14+
* `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()`
2222
* new `fixHolesLayout()` method in case your Morphs have untouchable areas ("holes")
2323
* "silent" - functions are no longer needed, e.g. `silentSetExtent()`, `silentMoveBy()`
2424
- `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
3737
- `new Color()`, `new Color(0, 0, 0)` => `BLACK`
3838
- `new Color(255, 255, 255)` => `WHITE`
3939
* `virtualKeyboard` property in Morphic preference has been deprecated
40-
* `fullImageClassic()` => is now always just `fullImage()`
40+
* `fullImageClassic()` => is now always just `fullImage()`
4141
* `keyboardReceiver` => `keyboardFocus`
4242
* keyboard navigation can be activated for any visible menu by pressing an arbitrary key
4343
* 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
4747

4848
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.
4949

50-
**Words to search your code for**
50+
**Words to search your code for:**
5151

5252
* **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

5959
* **cachedFullImage** => no longer supported, remove all references
60-
* **fullImageClassic** => rename method calls to just fullImage()
60+
* **fullImageClassic** => rename method calls to just `fullImage()`
6161
* **silentSet**
6262
- remove method definitions
6363
- 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()`
7070
* **silentReplace** => (Snap! only) use replace instead
7171
* **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
7676
* **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
79+
* **new Color(255, 255, 255)** => `WHITE`

0 commit comments

Comments
 (0)