jonobr1 / two.js

A renderer agnostic two-dimensional drawing api for the web.
https://two.js.org
MIT License
8.27k stars 454 forks source link

[Bug] Negative scale does not work, with webgl mode only #723

Open Nicoco220983 opened 4 months ago

Nicoco220983 commented 4 months ago

Negative scale does not work, with webgl mode only.

To Reproduce

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <script src="build/two.min.js"></script>
  </head>
  <body>
    <script>
        var two = new Two({
            type: Two.Types.webgl,
            fullscreen: true,
            autostart: true
        }).appendTo(document.body)
        const shape = two.makeRectangle(two.width * .5, two.height * .5, 100, 100)
        shape.scale = -.5
    </script>
  </body>
</html>

Expected behavior The rectangle should be visible (it is when desactivating webgl mode)

Desktop (please complete the following information):

jonobr1 commented 4 months ago

Ah yes, this is likely because all the objects in WebGL are rendered on one side. I'll look into this.