SwiftGD icon indicating copy to clipboard operation
SwiftGD copied to clipboard

swiftGD.Image isn't able to draw a tilted/rotated rectangle

Open vitalz opened this issue 4 years ago • 4 comments

swiftGD.Image isn't able to draw a titled/rotated rectangle (both 'stroke' and filled)

vitalz avatar Jun 28 '20 19:06 vitalz

It looks libgd doesn't have such ability itself but SwiftGD is a bridge and could add such feature out of box. Otherwise another options (graph libs) adapted to Swift have to be figured out.

vitalz avatar Jun 28 '20 19:06 vitalz

The old school way to do this is simply to draw the filled rectangle, then draw the bordered (no fill) rectangle on top. Given that libgd is a very lightweight old school library, that's how I'd accomplish the task.

deirdresm avatar Apr 14 '21 18:04 deirdresm

@vitalz I wouldn’t expect SwiftGD to do this out of the box. It’s more of a direct port of gd and should behave like gd does.

Of course, you could write your own methods to accomplish what you’re after.

mcritz avatar Apr 14 '21 21:04 mcritz

The old school way to do this is simply to draw the filled rectangle, then draw the bordered (no fill) rectangle on top. Given that libgd is a very lightweight old school library, that's how I'd accomplish the task.

By tilted I meant a rotated rectangle. Wrongly used titled.

vitalz avatar Apr 26 '21 11:04 vitalz