From 5799f74d30817ae85b442b49a821748d95dcbbf5 Mon Sep 17 00:00:00 2001 From: Kris <1611248+Rinzwind@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:00:09 +0100 Subject: [PATCH 1/2] Made #recalculatePageWidths on SpMorphicMillerAdapter set the left coordinate and width of each widget to integral numbers. --- .../SpMorphicMillerAdapter.class.st | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st index 516e78e0..ef5a717a 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st @@ -170,7 +170,7 @@ SpMorphicMillerAdapter >> recalculatePageHeights [ { #category : 'private' } SpMorphicMillerAdapter >> recalculatePageWidths [ - | newWidth widgets width | + | newWidth widgets width right | widgets := self childrenWidgets. width := self widget width. @@ -181,10 +181,12 @@ SpMorphicMillerAdapter >> recalculatePageWidths [ visiblePages := layout visiblePages min: widgets size. (width / visiblePages) - (layout spacing / visiblePages) ]. + right := (widgets size * newWidth) floor. widgets reverseWithIndexDo: [ :each :index | - each - left: (index - 1) * newWidth; - width: newWidth ] + | left | + left := ((index - 1) * newWidth) floor. + each left: left; width: right - left. + right := left ] ] { #category : 'private' } From 8032d4972adeaa0dec75c63adf0679c0ceb1f113 Mon Sep 17 00:00:00 2001 From: Kris <1611248+Rinzwind@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:00:43 +0100 Subject: [PATCH 2/2] Made #recalculatePageHeights on SpMorphicMillerAdapter set the top coordinate and height of each widget to integral numbers. --- .../SpMorphicMillerAdapter.class.st | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st index ef5a717a..7f6f33ef 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st @@ -155,17 +155,19 @@ SpMorphicMillerAdapter >> newVertical [ { #category : 'private' } SpMorphicMillerAdapter >> recalculatePageHeights [ - | newHeight widgets height | + | newHeight widgets height bottom | height := self widget height. widgets := self childrenWidgets. newHeight := widgets size = 1 ifTrue: [ height ] ifFalse: [ height / (layout visiblePages min: widgets size) - (layout spacing / (layout visiblePages min: widgets size)) ]. + bottom := (widgets size * newHeight) floor. widgets reverseWithIndexDo: [ :each :index | - each - top: (index - 1) * newHeight; - height: newHeight ] + | top | + top := ((index - 1) * newHeight) floor. + each top: top; height: bottom - top. + bottom := top ] ] { #category : 'private' }