• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Business as usual: Flipped context causing grief
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Business as usual: Flipped context causing grief


  • Subject: Re: Business as usual: Flipped context causing grief
  • From: Graham Cox <email@hidden>
  • Date: Tue, 13 Dec 2011 12:07:58 +1100

On 13/12/2011, at 12:00 PM, Keary Suska wrote:

> IIRC, NSLayoutManager expects that the view it is drawing in is flipped

It expects the CONTEXT it is drawing into is flipped, and in order to do that it asks the CONTEXT the value of -isFlipped.

If the context is associated with a view, the view is queried.

I don't have a view, I have a context. I create the context from a bitmap rep (I'm rendering text, and other things, into an offscreen image). When you do that, it assumes that the context/bitmap is not flipped, and -isFlipped returns NO. There is no way I can see to return YES from isFlipped, or pass setFlipped:YES to the context, or set the flippedness to YES when the context is created.

That is the problem I have.

> (-isFlipped returns YES). If it isn't, it will draw text inverted. Soooo.. I think all you need is to implement isFlipped returning YES.


I suppose I could do this by subclassing NSGraphicsContext, but that seems a surprising requirement given the task I'm trying to perform. Surely correctly rendering text into a bitmap rep is something that the design of the graphics system has anticipated?

--Graham



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Business as usual: Flipped context causing grief
      • From: Aki Inoue <email@hidden>
    • Re: Business as usual: Flipped context causing grief
      • From: Keary Suska <email@hidden>
References: 
 >Business as usual: Flipped context causing grief (From: Graham Cox <email@hidden>)
 >Re: Business as usual: Flipped context causing grief (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: Business as usual: Flipped context causing grief
  • Next by Date: Re: Business as usual: Flipped context causing grief
  • Previous by thread: Re: Business as usual: Flipped context causing grief
  • Next by thread: Re: Business as usual: Flipped context causing grief
  • Index(es):
    • Date
    • Thread