<div dir="ltr">Hi Hannes,<div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 29, 2017 at 8:45 AM, H. Hirzel <span dir="ltr"><<a href="mailto:hannes.hirzel@gmail.com" target="_blank">hannes.hirzel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi Chris,<br>
<span class="gmail-"><br>
On 3/29/17, Chris Cunningham <<a href="mailto:cunningham.cb@gmail.com">cunningham.cb@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> yes, / vs // is definitely worth the effort.  For this use case, I am<br>
> utilizing Rectangle to represent rectangles that I want to place in a Visio<br>
> drawing, and that representation uses fractional measurements (inches, say)<br>
> instead of pixels.<br>
<br>
</span>In the context of pixel based Rectangles it makes no sense.<br>
<br>
If we talk about measurements in inches and centimeters than it is<br>
fine. But the class Rectangle is not about that.<br></blockquote><div><br></div><div>How do you know?  Just because Rectangle and Point are used in the graphics subsystem does not mean that their use is limited only to that domain.  There is nothing that prevents one from creating, for example, </div><div> </div><div><div>    0.25 asPoint extent: 1    =>    0.25@0.25 corner: 1.25@1.25<br></div></div><div><br></div><div>I think Chris' method makes perfect sense.  This is a polymorphic system; the abstractions within it are broadly applicable.  The kind of thinking which restricts the system, such as adding methods that logically belong to SequenceableCollection to, say, String, simply because the programmer wanted a String method and didn't think about generality, is at best regrettable.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="gmail-">> A better question is should I be using Rectangle for this.  Maybe we should<br>
> create a 'TrueRectangle' class or something similar so that we can actually<br>
> talk about and share what can really be done with rectangles, instead of<br>
> the 'ScreenRectangle' that we have today called Rectangle.<br></span></blockquote><div><br></div><div>Why not the other way around? Add IntegralRectangle and have it specialize Rectangle.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="gmail-">
<br>
</span>I prefer this. Actually I need such a class as well. At the moment I<br>
work with RectangleMorph.<br>
<span class="gmail-"><br>
<br>
> That said, this change does let me work with rectangle for this purpose,<br>
> but it does move the class away from our pixel based rectangle.<br>
<br>
</span>I do not understand how this change helps you with that ....<br>
<br>
--Hannes<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
> -cbc<br>
><br>
> On Wed, Mar 29, 2017 at 6:21 AM, H. Hirzel <<a href="mailto:hannes.hirzel@gmail.com">hannes.hirzel@gmail.com</a>> wrote:<br>
><br>
>> What is the difference to the existing method ?<br>
>><br>
>> center: centerPoint extent: extentPoint<br>
>>         "Answer an instance of me whose center is centerPoint and width<br>
>>         by height is extentPoint.  "<br>
>><br>
>>         ^self origin: centerPoint - (extentPoint//2) extent: extentPoint<br>
>><br>
>> Is / vs // worth the effort?<br>
>><br>
>> On Wed, 29 Mar 2017 00:18:24 0000, <a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a><br>
>> <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br>
>> > A new version of Graphics was added to project The Inbox:<br>
>> > <a href="http://source.squeak.org/inbox/Graphics-cbc.372.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/<wbr>inbox/Graphics-cbc.372.mcz</a><br>
>> ><br>
>> > ==================== Summary ====================<br>
>> ><br>
>> > Name: Graphics-cbc.372<br>
>> > Author: cbc<br>
>> > Time: 28 March 2017, 5:18:09.019402 pm<br>
>> > UUID: 7b9783b1-87c5-3549-ac32-<wbr>42acd6abcb12<br>
>> > Ancestors: Graphics-eem.371<br>
>> ><br>
>> > Added method to allow creating a rectangle based on teh center of the<br>
>> > rectangle.<br>
>> ><br>
>> > =============== Diff against Graphics-eem.371 ===============<br>
>> ><br>
>> > Item was added:<br>
>> > + ----- Method: Rectangle class>>exactCenter:extent: (in category<br>
>> 'instance<br>
>> > creation') -----<br>
>> > + exactCenter: centerPoint extent: extentPoint<br>
>> > +     "Answer an instance of me whose center is centerPoint and width<br>
>> > +     by height is extentPoint. "<br>
>> > +     ^ self origin: centerPoint - (extentPoint / 2) extent:<br>
>> > extentPoint<br>
>> > + !<br>
>> ><br>
>> ><br>
>> ><br>
>><br>
>><br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>