crayon icon indicating copy to clipboard operation
crayon copied to clipboard

Add .crop(x, y, width, height) to GraphicsTexture

Open blakeohare opened this issue 7 years ago • 0 comments

Be sure the following situation is tested thoroughly, particularly on texture-based GL platforms, where the image resources are basically the original-scale composite assets plus some rectangleF's describing the cumulative transformations:

Consider an image that is 1 pixel tall and 2 pixels wide and looks like this: [red, blue] Scaling to 6 pixels should look like this, unambiguously (nearest neighbor should always be used): [red, red, red, blue, blue, blue] Then crop down to the middle 2 pixels: [red, blue] This should be a crisp red pixel and blue pixel, not two purple pixels.

For non-GL platforms where the image is re-rasterized after every mutation, this should be a trivial test case.

blakeohare avatar Jun 11 '17 07:06 blakeohare