Skip to content

Conversation

ggcrunchy
Copy link
Contributor

This fixes a bug described here:

The two-argument ContentToScreen() is used for convenience when calculating the pixel dimensions of the canvas, since the coordinates would go unused. Unfortunately, that's meant for coordinates, and so it drags any non-0 screen origins into the calculation.

(Snapshots also do this.)

A more minor issue: if pixelWidth or pixelHeight was provided as a canvas option, but not both, they were ignored.

This also adds a (backward-compatible) shorthand for setting width and pixelWidth to the same value (ditto height): if pixelWidth is provided but not width, it will be used for both.

…involve origins in calculation


pixelWidth and pixelHeight ignored unless both were set

Allow pixelWidth to be used as width if the latter is absent (ditto height)
@ggcrunchy ggcrunchy requested a review from Shchvova as a code owner February 2, 2023 00:57
@Shchvova Shchvova merged commit dff89b1 into coronalabs:experimental Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants