Rectangle and RectangleBorder don't like negative width/height

Avatar
  • updated
  • Fixed

RectangleBorder shows a filled rectangle when Rect has negative width/height:

Shapes.Draw.RectangleBorder(new Rect(Vector2.zero, new Vector2(1, 1)), 1 / 100f, Color.green);   // works!
Shapes.Draw.RectangleBorder(new Rect(Vector2.zero, new Vector2(-1, 1)), 1 / 100f, Color.red);    // the rectangle is filled with the color
Shapes.Draw.RectangleBorder(new Rect(Vector2.zero, new Vector2(1, -1)), 1 / 100f, Color.yellow); // the rectangle is filled with the color
Shapes.Draw.RectangleBorder(new Rect(Vector2.zero, new Vector2(-1, -1)), 1 / 100f, Color.blue);  // the rectangle is filled with the color

Rectangle doesn't show anything when Rect has negative width/height:

Shapes.Draw.Rectangle(new Rect(Vector2.zero, new Vector2(1, 1)), 1 / 100f, Color.green);   // works!
Shapes.Draw.Rectangle(new Rect(Vector2.zero, new Vector2(-1, 1)), 1 / 100f, Color.red);    // ?
Shapes.Draw.Rectangle(new Rect(Vector2.zero, new Vector2(1, -1)), 1 / 100f, Color.yellow); // ?
Shapes.Draw.Rectangle(new Rect(Vector2.zero, new Vector2(-1, -1)), 1 / 100f, Color.blue);  // ?

Thanks!

Reporting a bug? please specify Unity version:
2019.4.11f1
Reporting a bug? please specify Shapes version:
2.3.1
Reporting a bug? please specify Render Pipeline:
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Fixed

negative width/height values are now allowed in 2.3.2

Avatar
Freya Holmér creator
  • Answer
  • Fixed

negative width/height values are now allowed in 2.3.2