2015-02-21 4:50 GMT+01:00 Sean P. DeNigris <sean@clipperadams.com>:
Sean P. DeNigris wrote
That worked
But actually, it was totally unnecessary! MorphicTransform's scaling method arguments were either named (unhelpfully) 's' or (misleadingly) 'aFloat', but apparently, I can just pass aPoint to scale x and y separately :)
Good to know! BTW I found a bug in isPureTranslation: (MorphicTransform offset:10@10 angle:0 degreesToRadians scale:1) isPureTranslation -> true (MorphicTransform offset:10@10 angle:0 degreesToRadians scale:1@1) isPureTranslation -> false
So I'm back to the simple version... drawOn: aCanvas
| transform widthScale heightScale | widthScale := self innerBounds width / self image width. heightScale := self innerBounds height / self image height. transform := MorphicTransform new withScale: widthScale@heightScale. aCanvas warpImage: self image transform: transform at: self innerBounds origin
Thanks for talking me through it! I learned a lot...
----- Cheers, Sean -- View this message in context: http://forum.world.st/Canvas-Transform-Width-and-Height-Independently-tp4806... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.