O oneHande macrumors newbie Original poster Oct 7, 2009 7 0 Oct 14, 2009 #1 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
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
R rossipoo macrumors regular Jun 7, 2009 109 0 Oct 14, 2009 #2 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) };
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) };