@mocanvas/mocanvas · constant

noteShapeMigrations

declare const noteShapeMigrations: PropsMigrations

The note shape's props migrations.

Version 2 changes what growY *means*. It is how much taller than its square the note had to be for the text to fit, and it used to be stored in screen-ish units — measured with the font, width and padding already multiplied by scale, then added to a scaled box:

`` was: height = 200 * scale + growY now: height = (200 + growY) * scale ``

Self-consistent either way, which is why nothing here ever caught it: the two agree whenever scale is 1 or growY is 0, and every note this codebase grew itself was correct. What they disagree about is every note that arrives from *outside* — a .tldr file, or an app writing records directly — where growY is in unscaled units. Such a note came out growY * (scale - 1) too short, so at scale 1.6 it lost 37.5% of its overflow and the text ran past the paper.

So the stored value is divided by the scale it was measured at, once.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.