• 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: Zooming images in NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Zooming images in NSView


  • Subject: Re: Zooming images in NSView
  • From: Chris Giordano <email@hidden>
  • Date: Sat, 11 Dec 2004 15:56:02 -0500

All,

On Dec 10, 2004, at 7:30 PM, John C. Randolph wrote:

On Dec 10, 2004, at 3:27 PM, Ricky Sharp wrote:

On Dec 10, 2004, at 1:36 PM, John C. Randolph wrote:


The simplest way is to shrink the bounds rect of the NSView by your zoom factor.

And here's an example of how to do so:

http://dts.apple.com/qa/QA1346/qa1346.html

The link should be <http://developer.apple.com/qa/qa2004/qa1346.html>, unless of course you work for Apple :)
Whoops! That will teach me to drop a link into a mail message without reading it..

-jcr


Thought I'd let everyone know of what looks like a bug in the -scalePercent method in the sample code.


The original implementation returns a result that is roughly the inverse of what one would expect. That is, one gets 50% instead of 200%, 25% instead of 400%, 200% instead of 50%, etc.

The fix is simple: divide 1 by the scale's width before multiplying by 100.

- (float) scalePercent
{
	return (1.0 / [self scale].width) * 100.0;
}

Reported this morning: <rdar://3916447>

_______________________________________________
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


  • Follow-Ups:
    • Re: Zooming images in NSView
      • From: "John C. Randolph" <email@hidden>
References: 
 >Zooming images in NSView (From: Joe Chan <email@hidden>)
 >Re: Zooming images in NSView (From: "John C. Randolph" <email@hidden>)
 >Re: Zooming images in NSView (From: Ricky Sharp <email@hidden>)
 >Re: Zooming images in NSView (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Cocoa HTML Decoder
  • Next by Date: isEditable
  • Previous by thread: Re: Zooming images in NSView
  • Next by thread: Re: Zooming images in NSView
  • Index(es):
    • Date
    • Thread