<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Christoph --<div class="mb_sig"></div>
                                        <div><br></div><div>> <span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">I think that Kent Beck at some point recommended not to define too many conversion messages, especially for very short and potentially misunderstandable selectors like these [...]</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Well, the next step for *you* would be to actually apply those best practices to any particular domain to then reason about possible next steps. Without proper application to concrete domains/scenarios, you are omitting to verify that you actually found a fitting best practice.</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Personally, I do not think that the one you quoted fits here. Neither "too many conversion messages" nor "</span><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">potentially misunderstandable selectors". #px, #pt, #em, and #ex sitting in "*Graphics-scale factor" have a clear relationship to Web development and CSS. I am confident that many if not most users will understand.</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">I will add an extra note to only use #ex and #em if really necessary. Yet, it makes sense to connect those concepts to the underlying system. At least from a documentation perspective.</span></div><div><br></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"> > </span><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Note that once we use this protocol consistently, the dependency browser and the dependency tests will no longer inform us about all dependencies to the Graphics package. Or am I wrong?</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">I am sure that you know other ways to track usage of such rather uncommon selectors... ;-P Not sure in which kind of scenarios you want to unload "Graphics". This is clearly a different topic.</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px"><br></span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Best,</span></div><div><span style="font-family: Calibri, Helvetica, sans-serif;font-size: 16px">Marcel</span></div><blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 22.06.2022 12:04:52 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style="font-family:Arial,Helvetica,sans-serif">


<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif">
<p>Ah, finally! :D I think that Kent Beck at some point recommended not to define too many conversion messages, especially for very short and potentially misunderstandable selectors like these, but on the other hand, I am just happy about the improved convenience.</p>
<p><br>
</p>
<p>Note that once we use this protocol consistently, the dependency browser and the dependency tests will no longer inform us about all dependencies to the Graphics package. Or am I wrong?</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><span style="font-family: Calibri, sans-serif;color: #000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Mittwoch, 22. Juni 2022 11:47:43<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Graphics-mt.524.mcz</span>
<div> </div>
</div>
</div>
<span style="font-size: 10pt"><span style="font-size: 10pt">
<div class="PlainText">Marcel Taeumel uploaded a new version of Graphics to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Graphics-mt.524.mcz">http://source.squeak.org/trunk/Graphics-mt.524.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Graphics-mt.524<br>
Author: mt<br>
Time: 22 June 2022, 11:47:35.985723 am<br>
UUID: fc41bc62-0b72-a14f-999b-12d64a0a0cff<br>
Ancestors: Graphics-mt.523<br>
<br>
Document programming model for scale-factor-aware applications.<br>
<br>
Note that this is not yet used throughout the system. However, applications written for Squeak 6.0 should be able to look as elegant as possible.<br>
<br>
=============== Diff against Graphics-mt.523 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Number>>em (in category '*Graphics-scale factor') -----<br>
+ em<br>
+        "Convert the receiver from multiples of width-of-capital-letter-M to pixels using the system's default font. Works also with pre-rendered fonts."<br>
+        <br>
+        ^ (self * (TextStyle defaultFont widthOf: $M)) rounded!<br>
<br>
Item was added:<br>
+ ----- Method: Number>>ex (in category '*Graphics-scale factor') -----<br>
+ ex<br>
+        "Convert the receiver from multiples of x-height-of-font to pixels using the system's default TrueType font."<br>
+ <br>
+        | tt |<br>
+        tt := TextStyle defaultTTFont ttcDescription.<br>
+        ^ (self asFloat<br>
+                * (tt xHeight asFloat / tt unitsPerEm)<br>
+                * (TextStyle defaultFont widthOf: $M)) rounded!<br>
<br>
Item was added:<br>
+ ----- Method: Number>>pt (in category '*Graphics-scale factor') -----<br>
+ pt<br>
+        "Convert the receiver from points to pixels. Note that this will not work correctly for 'faked' scale factors where larger (pre-rendered) fonts are used instead of adjusting the system's current ppi value."<br>
+ <br>
+        ^ (TextStyle pointsToPixels: self) rounded<br>
+ <br>
+ "<br>
+ (TextStyle pixelsPerInch = 96.0 ifTrue: [<br>
+        | extra |<br>
+        extra := TextStyle defaultFont pointSize / TTCFont referencePointSize.<br>
+        ^ (TextStyle pointsToPixels: self * extra) rounded]<br>
+ "!<br>
<br>
Item was added:<br>
+ ----- Method: Number>>px (in category '*Graphics-scale factor') -----<br>
+ px<br>
+        "Convert the receiver representing raw pixels at 100% (96ppi) to the current scale factor. Note that you currently have to do this manually for all graphics-related properties and layout-specific measures such as #borderWidth: and #layoutInset:. Only
 for model windows (see #initialExtent) that are no dialogs, that scaling will happen automatically in ToolBuilder."<br>
+ <br>
+        self flag: #discuss. "mt: For self > 4, I would recommend #rounded instead of #truncated. For smaller values, however, rounding makes no sense because we have no sub-pixel access and things would look too big too soon."<br>
+        ^ (self * RealEstateAgent scaleFactor) truncated!<br>
<br>
<br>
</div>
</span></span>
</div></blockquote></div>