Effectiveness of setting stroke color and bound rotation

I don’t understand this but I just noticed this strange behaviour.

Before describing that, let me tell you about the structure of my code first.

  1. It rotates a bounds rectangle in clock-wise first.
  2. it draws an image
  3. it rotates the bound rectangle in counter-clock-wise
  4. it draws the bounds rectangle to show the bounds of the current view ( strokes the rect. )

In one experiment, I set the stroke color before step 3 to red.
Then at the step 4, the bound rectangle is drawn in black color.

Setting stroke color doesn't work

Then, if I set the stroke color after step 3, it draws the rectangle in red as expected.

Setting stroke color works

So, it looks like that rotation of bounds rectangle affect the effectiveness of setting stroke color.
Probably the graphics context is reset after rotation?


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: