Hi Christoph, I do not agree. Most certainly, if some fraction is un-initialized, it's because we only specified the offset and want an absolute layout. Likewise, if offset are un-initialized, it's because we only specified a purely proportional layout and just want that. This makes zero the best default value (least surprising).
if someone wants a full layout default, then he just has to specify LayoutFrame full, or something like that.
Look in inbox, this goes very well. Let's eradicate those inaesthetic ifNil: [], YAGNI.
Le lun. 17 févr. 2020 à 16:55, Thiede, Christoph < Christoph.Thiede@student.hpi.uni-potsdam.de> a écrit :
Hm ... sorry, this does not yet convince me. :)
I think the best idea of a default LayoutFrame is fullscreen. This would be LayoutFrame fractions: (0 @ 0 rect: 1 @ 1) offsets: (0 @ 0 rect: 0 @ 0).
Apart from that, there is a big number of nil checks in LayoutFrame. If we introduce something like #fixup, we should also get rid of all these nil checks. Or at least, define a consistent fallback for a nil value, so either we keep the nil values as in Graphics-ct.426, or we introduce #fixUp as in Graphics-nice.425 AND change or delete #minExtentFrom: & Co.
Best,
Christoph
*Von:* Squeak-dev squeak-dev-bounces@lists.squeakfoundation.org im Auftrag von Nicolas Cellier nicolas.cellier.aka.nice@gmail.com *Gesendet:* Montag, 17. Februar 2020 16:06:38 *An:* The general-purpose Squeak developers list *Betreff:* Re: [squeak-dev] The Inbox: Graphics-jr.425.mcz
But these are unsent messages in trunk...
Le lun. 17 févr. 2020 à 15:52, Christoph Thiede < christoph.thiede@student.hpi.uni-potsdam.de> a écrit :
Do we rely anywhere on having nil fractions?
Yes, apparently we do, have a look at #minWidthFrom:
... right := rightFraction ifNil: [1.0]. ...
Just fixed this in Graphics-ct.426.
-- Sent from: http://forum.world.st/Squeak-Dev-f45488.html