A new version of Graphics was added to project The Inbox:
http://source.squeak.org/inbox/Graphics-ct.449.mcz ==================== Summary ==================== Name: Graphics-ct.449 Author: ct Time: 6 May 2021, 10:46:15.911809 pm UUID: 52f12efc-da63-0d44-a252-72bc5f89b6c7 Ancestors: Graphics-mt.448 Proposal: Adds Form >> #scaledBy: that scales a form by a certain factor. I identified half a dozen of senders of #scaledToSize: in the Trunk each of which has reinvented this wheel. =============== Diff against Graphics-mt.448 =============== Item was added: + ----- Method: Form>>scaledBy: (in category 'scaling, rotation') ----- + scaledBy: factor + "Answer a version of the receiver which is scaled by factor, which can be a number or point." + + (factor closeTo: 1) ifTrue: [^ self]. + ^ self scaledToSize: (self extent * factor) rounded! |
If you merge this proposal, please consider merging the attached changeset as well, which eliminates the duplication from the mentioned senders. :-)
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Donnerstag, 6. Mai 2021 22:46:23 An: [hidden email] Betreff: [squeak-dev] The Inbox: Graphics-ct.449.mcz A new version of Graphics was added to project The Inbox:
http://source.squeak.org/inbox/Graphics-ct.449.mcz ==================== Summary ==================== Name: Graphics-ct.449 Author: ct Time: 6 May 2021, 10:46:15.911809 pm UUID: 52f12efc-da63-0d44-a252-72bc5f89b6c7 Ancestors: Graphics-mt.448 Proposal: Adds Form >> #scaledBy: that scales a form by a certain factor. I identified half a dozen of senders of #scaledToSize: in the Trunk each of which has reinvented this wheel. =============== Diff against Graphics-mt.448 =============== Item was added: + ----- Method: Form>>scaledBy: (in category 'scaling, rotation') ----- + scaledBy: factor + "Answer a version of the receiver which is scaled by factor, which can be a number or point." + + (factor closeTo: 1) ifTrue: [^ self]. + ^ self scaledToSize: (self extent * factor) rounded!
Carpe Squeak!
|
In reply to this post by commits-2
Hi Christoph,
What about just using #magnifyBy:? Levente On Thu, 6 May 2021, [hidden email] wrote: > A new version of Graphics was added to project The Inbox: > http://source.squeak.org/inbox/Graphics-ct.449.mcz > > ==================== Summary ==================== > > Name: Graphics-ct.449 > Author: ct > Time: 6 May 2021, 10:46:15.911809 pm > UUID: 52f12efc-da63-0d44-a252-72bc5f89b6c7 > Ancestors: Graphics-mt.448 > > Proposal: Adds Form >> #scaledBy: that scales a form by a certain factor. I identified half a dozen of senders of #scaledToSize: in the Trunk each of which has reinvented this wheel. > > =============== Diff against Graphics-mt.448 =============== > > Item was added: > + ----- Method: Form>>scaledBy: (in category 'scaling, rotation') ----- > + scaledBy: factor > + "Answer a version of the receiver which is scaled by factor, which can be a number or point." > + > + (factor closeTo: 1) ifTrue: [^ self]. > + ^ self scaledToSize: (self extent * factor) rounded! |
D'oh, I seem to have missed this selector! "magnify" is just the not verb I was searching for. :-)
Is it of interest that I update the changeset below to reuse #magnifyBy: in more places?
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von Levente Uzonyi <[hidden email]>
Gesendet: Freitag, 7. Mai 2021 21:45:29 An: [hidden email] Betreff: Re: [squeak-dev] The Inbox: Graphics-ct.449.mcz Hi Christoph,
What about just using #magnifyBy:? Levente On Thu, 6 May 2021, [hidden email] wrote: > A new version of Graphics was added to project The Inbox: > http://source.squeak.org/inbox/Graphics-ct.449.mcz > > ==================== Summary ==================== > > Name: Graphics-ct.449 > Author: ct > Time: 6 May 2021, 10:46:15.911809 pm > UUID: 52f12efc-da63-0d44-a252-72bc5f89b6c7 > Ancestors: Graphics-mt.448 > > Proposal: Adds Form >> #scaledBy: that scales a form by a certain factor. I identified half a dozen of senders of #scaledToSize: in the Trunk each of which has reinvented this wheel. > > =============== Diff against Graphics-mt.448 =============== > > Item was added: > + ----- Method: Form>>scaledBy: (in category 'scaling, rotation') ----- > + scaledBy: factor > + "Answer a version of the receiver which is scaled by factor, which can be a number or point." > + > + (factor closeTo: 1) ifTrue: [^ self]. > + ^ self scaledToSize: (self extent * factor) rounded!
Carpe Squeak!
|
Free forum by Nabble | Edit this page |