Is this a Drawing Canvas Snapshot measurement bug?

0 favourites
  • 3 posts
From the Asset Store
Pixel Destruction like in "Worms" (Drawing Canvas based)
  • My monitor is at 1920,1080 resolution, as my viewport and layer size in the engine.

    When I changed the resolution, obviously the snapshot changed sizes, but How come a 256 by 256 Canvas is measured at 257 and 257 in the undisturbed 1920 by 1080 resolution?

  • I believe even when the game resolution matches screen resolution, snapshot resolution is still re-calculated from the pixel scale ratio. So this is a rounding error.

    Have you tried enabling fixed resolution in canvas properties?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Drawing Canvas's automatic resolution mode tries to match the resolution it is displayed at. However as everything can be sized and scaled at fractional values, it's possible the Drawing Canvas ends up at a fractional size like 256.5 x 256.5. It is not possible to allocate half a pixel - the surface size must be an integer. So in this case it rounds the surface size up to 257x257, and then displays only a 256.5 x 256.5 size area from that surface. That allows the same fractional display sizing that other objects support, but means that sometimes the surface size is unexpectedly one pixel larger. It's not a bug, just a consequence of this design.

    You can snapshot an area of the canvas, so you can snapshot the size you really want (e.g. 256x256), or you can use fixed resolution mode which bypasses all that fractional sizing logic.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)