Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

oneHande

macrumors newbie
Original poster
Oct 7, 2009
7
0
hello,
when you drag and drop a NSImage,
it is placed by its "bounds" origin : point left down

is it an API method to force application to place them
by their center ?

thank you
 

rossipoo

macrumors regular
Jun 7, 2009
109
0
All you have to do is subtract half of the image dimentions from the point of placement.

NSSize imageSize;
NSPoint center;
NSPoint placement = { center.x - (imageSize.width / 2), center.y - (imageSize.width / 2) };
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.