Scaling CALayer produces blurry/distorted text

2011-06-30 Thread Ajay Sabhaney
Hello, I have an application in which the user can continuously zoom and pan a canvas (kind of like Google Maps). On the canvas, a user can have multiple text items. Each text item is a Core Animation layer, and the text is drawn using NSLayoutManager's drawGlyphsForGlyphRange method. When

FSEvents - handling kFSEventStreamEventFlagRootChanged flag

2011-06-16 Thread Ajay Sabhaney
Hello, I have setup an FSEventStream so that I can monitor a directory for file changes. If the root directory that is being watched is moved/renamed, I want to be able to keep monitoring the directory. I am able to get the new path of the root directory, however I am unsure of how to monitor

Re: Linearly Scaling Text

2011-05-30 Thread Ajay Sabhaney
I hope that there are no issues scaling an NSTextView that is layer-backed (either using NSView's scaleUnitSquareToSize method, or the bounds manipulation approach that TextEdit uses). Unfortunately, there seems to be issues with scaling an NSTextView in a layer-backed hierarchy as well - I

Re: Linearly Scaling Text

2011-05-30 Thread Ajay Sabhaney
Because it was mono-Font text, I resorted to scaling the font instead. Actually I did try scaling the font instead of the text view, but I'm unable to get the text to scale linearly as our application should be able to handle most fonts. I never went back to view scaling, but I wonder if

Re: Linearly Scaling Text

2011-05-29 Thread Ajay Sabhaney
Also, you should disable screen font substitution via -[NSLayoutManager setUsesScreenFont:NO]. This is the main source of glyph advancement differences you're seeing. Thanks Aki, indeed this has removed the small horizontal offset that was there. I am however unable to figure out where

Re: Linearly Scaling Text

2011-05-29 Thread Ajay Sabhaney
On 2011-05-25, at 3:41 PM, Douglas Davidson wrote: On May 25, 2011, at 2:37 PM, Ajay Sabhaney wrote: - Instead of trying to scale text linearly, use a transformation to scale the NSTextView and image representation appropriately. While this is easy to do with an image, I am having

Re: Linearly Scaling Text

2011-05-29 Thread Ajay Sabhaney
Also, you should disable screen font substitution via -[NSLayoutManager setUsesScreenFont:NO]. This is the main source of glyph advancement differences you're seeing. Thanks Aki, indeed this has removed the small horizontal offset that was there. I am however unable to figure out

Re: Linearly Scaling Text

2011-05-29 Thread Ajay Sabhaney
Thanks Kyle, that's quite helpful. We were initially hesitant to add the NSTextView directly to the layer-hosted view, however the following thread consoled us a little, especially since we were able to get geometry working correctly:

Linearly Scaling Text

2011-05-25 Thread Ajay Sabhaney
Hello list, I am working on an application in which a user may insert, resize, and edit text boxes in a workspace. We anticipate that a single user will have many (possibly hundreds) of text items in a workspace. The user is also able to pan and zoom in/out of a workspace. Because of the

Shadow on a Borderless Window

2010-10-31 Thread Ajay Sabhaney
Hello list, I am creating a window with a borderless style mask applied. Even though content is drawn, the shadow of the window is much less intense than normal windows. I've tried the setHasShadow: setter and using the invalidateShadow method, however neither work. I've found one similar

Core Data and Managed Object Context Question

2010-09-08 Thread Ajay Sabhaney
Hello list, I have a Core Data based application with a simple data model. There is an entity 'ItemContainer' which has a to-many relationship with the entity 'Item'. An item model entity corresponds to a Core Animation layer, so when a new Item managed object is added to the ItemContainer

Re: NSArrayController + KVO + Core Data Question

2010-08-23 Thread Ajay Sabhaney
On 2010-08-22, at 11:54 PM, Jerry Krinock wrote: it was *necessary* [emphasis added] for me to receive a KVO notification when either a new item was added to the array controller, or removed from the array controller I'd say that this assumption is the problem. What you probably

Re: NSArrayController + KVO + Core Data Question

2010-08-23 Thread Ajay Sabhaney
I'm guessing, but you seem to have a managed object with a to-many relationship, and you want to be notified whenever anything is added to or removed from that relationship property. So, observe that property of the managed object, and you're done. If there's something more complicated

Re: NSArrayController + KVO + Core Data Question

2010-08-23 Thread Ajay Sabhaney
I'm guessing, but you seem to have a managed object with a to-many relationship, and you want to be notified whenever anything is added to or removed from that relationship property. I think I understand the confusion now. I do not actually have a managed object that has a to-many

Re: NSArrayController + KVO + Core Data Question

2010-08-23 Thread Ajay Sabhaney
Try using a technique similar to the Department/Employees Core Data tutorial in the documentation. That is, you can have a singleton object of a new entity, (say, ItemSet), which has a to-many relationship items to all of the Item objects. Bind the NSArrayController's content to the items

NSArrayController + KVO + Core Data Question

2010-08-22 Thread Ajay Sabhaney
Hello all, In my Core Data based application, I have an NSArrayController, and it was necessary for me to receive a KVO notification when either a new item was added to the array controller, or removed from the array controller. By looking in to some forums, I found out that I cannot do this

Re: Odd Behaviour with CALayer

2010-06-18 Thread Ajay Sabhaney
: On Thu, Jun 17, 2010 at 5:09 PM, Ajay Sabhaney co...@mothercreative.com wrote: -The initializer initWithLayer: of my subclass of CALayer, MRWorkspaceItemLayer is being invoked, even though I never explicitly invoke this The documentation for -[CALayer initWithLayer:] describes how

Odd Behaviour with CALayer

2010-06-17 Thread Ajay Sabhaney
Hello list, In my application, there are several CALayers (actually subclasses of CALayers) that are sublayers of my root layer. The user can then drag these layers around and select them, etc. Dragging works fine. When a user selects/deselects one of the layers, the following code snippet

Re: Odd Behaviour with CALayer

2010-06-17 Thread Ajay Sabhaney
On 2010-06-17, at 5:19 PM, David Duncan wrote: On Jun 17, 2010, at 2:04 AM, Ajay Sabhaney wrote: ab.borderColor=CGColorCreateGenericRGB(1.0f,1.0f,1.0f,1.0f); Be aware that you are actually leaking a color here. Core Animation retains all CF-type data that it gets, but since