Scaling view
Scaling view
- Subject: Scaling view
- From: Lorenzo <email@hidden>
- Date: Sun, 24 Sep 2006 20:42:28 +0200
Hi,
I scale my NSView horizontally.
Therefore all its subviews look scaled horizontally.
Each subviews has an icon and I need to leave this icon unscaled.
So in the subview drawRect method I re-scale the icon so it will look not
scaled.
inRect = NSMakeRect(3.0f * scaleFactor, 1.0f,
iconWidth * scaleFactor, iconHeight);
[mIcon drawInRect:inRect fromRect:NSZeroRect
operation:oper fraction:fraction];
When scaleFactor is > 0.0 (smaller view) the icon looks good.
When scaleFactor is < 0.0 (bigger view) the icon looks deformed (bad
scaling). I suppose that drawInRect rounds the rect to the integer pixel, so
when the scaling of the superview comes (later) I get a wrong final rect.
How can I avoid this?
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden