2017-07-11 20:59 GMT+02:00 Matteo <matteob8@yahoo.it>:
On 10/07/17 21:54, Nicolai Hess wrote:
2017-07-04 23:54 GMT+02:00 Matteo via Pharo-users < pharo-users@lists.pharo.org>:
---------- Weitergeleitete Nachricht ---------- From: Matteo <matteob8@yahoo.it> To: "Pharo is welcome (ML)" <pharo-users@lists.pharo.org> Cc: Bcc: Date: Tue, 4 Jul 2017 23:54:06 +0200 Subject: The method Form>>rotateBy: slows down if applied several times to the same form Dears, applying the method "Form>>rotateBy:" several times, to the same form, the system slows down dramatically, even imposing a 0° rotation.
Below you can find a code snippet, to be run on the playground:
|aForm | aForm:= ImageReadWriter formFromFileNamed: 'pharo.png'. 10 timesRepeat: [ aForm := aForm rotateBy:90 ].
Increasing the number of repetitions the delay get worse.
Does someone else get the same issue? Is there something wrong on my code, or in the way I'm using the method?
Hi Matteo,
thanks for this contribution. It is good that you found out the reason for the slowing down (repeatly creating a bigger form is of course not good).
I looked at your fix, it seems to work but both new methods are nearly identically, maybe it would be better to create another method for the common parts.
And I saw that there is another method
Form rotateBy: direction centerAt: aPoint
with direction could be either #left or #right and it will rotate cw/ccw by 90 degree
would this be useable for your use case?
nicolai
Hi Nicolai, you're right: my methods "rotateByQuarterCCW" and "rotateByQuarterCW" are redundant.
The method "rotateBy: direction centerAt: aPoint" does the same thing.
Sorry for the trouble, but I got misled be the selectors: "rotateBy:" "rotateBy:smoothing:" "rotateBy:magnify:smoothing:"
that works differently than "rotateBy:centerAt:".
What should I do with the fogbugz n° 20216?
Thanks, Matteo
Yes, I think it is Ok, to close the issue (as you already did). And it is good to comment why this is closed and what method can be used instead. Thank you Matteo.