twostraws / SwiftGD

A simple Swift wrapper for libgd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

vitalz opened this issue · comments

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

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.

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.

@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.

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.