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
The test has been launched in a Pharo 6.0 image, Latest update: #60499, under Linux 64bit.
For this question I opened the FogBugz case n°20216
https://pharo.fogbugz.com/f/cases/20216#BugEvent.190469
Thanks, Matteo