From a772cb15118e5c7fe781da9afad2cfebe9f92ea2 Mon Sep 17 00:00:00 2001 From: "adrien.vanegue.etu" Date: Mon, 22 Jan 2024 13:54:14 +0100 Subject: [PATCH 1/5] adding traces in SpMorphicMillerAdapter to trace problems in CI --- .../BaselineOfNewTools.class.st | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/BaselineOfNewTools/BaselineOfNewTools.class.st b/src/BaselineOfNewTools/BaselineOfNewTools.class.st index 2758bff0..f96a28b2 100644 --- a/src/BaselineOfNewTools/BaselineOfNewTools.class.st +++ b/src/BaselineOfNewTools/BaselineOfNewTools.class.st @@ -187,7 +187,26 @@ BaselineOfNewTools >> packageRepositoryURLForSpec: spec [ { #category : 'actions' } BaselineOfNewTools >> postload: loader package: packageSpec [ - MCMethodDefinition initializersEnabled: initializersEnabled + MCMethodDefinition initializersEnabled: initializersEnabled. + SpMorphicMillerAdapter compiler + source: 'scrollToShowLastPage + + self widget defer: [ + | size firstMorphIndex | + size := innerWidget submorphs size. + (''size := {1}'' format: { size }) traceCr. + (''widget := {1}, { 2 } '' format: { + innerWidget. + innerWidget submorphs }) traceCr. + firstMorphIndex := size - self presenter visiblePages + 1. + (''self presenter visiblePages := {1}'' format: + { self presenter visiblePages }) traceCr. + (''firstMorphIndex := {1}'' format: { firstMorphIndex }) traceCr. + (''((firstMorphIndex max: 1) min: size) := {1}'' format: + { ((firstMorphIndex max: 1) min: size) }) traceCr. + self widget showMorph: + (innerWidget submorphs at: ((firstMorphIndex max: 1) min: size)) ]'; + install ] { #category : 'actions' } From 2c3adfa9e53c97de226ff61a4ea89baf23f9523c Mon Sep 17 00:00:00 2001 From: "adrien.vanegue.etu" Date: Mon, 22 Jan 2024 14:04:22 +0100 Subject: [PATCH 2/5] more traces --- src/BaselineOfNewTools/BaselineOfNewTools.class.st | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/BaselineOfNewTools/BaselineOfNewTools.class.st b/src/BaselineOfNewTools/BaselineOfNewTools.class.st index f96a28b2..8eeb5899 100644 --- a/src/BaselineOfNewTools/BaselineOfNewTools.class.st +++ b/src/BaselineOfNewTools/BaselineOfNewTools.class.st @@ -195,9 +195,10 @@ BaselineOfNewTools >> postload: loader package: packageSpec [ | size firstMorphIndex | size := innerWidget submorphs size. (''size := {1}'' format: { size }) traceCr. - (''widget := {1}, { 2 } '' format: { - innerWidget. - innerWidget submorphs }) traceCr. + (''widget := {1} '' format: { innerWidget }) traceCr. + (''widget submorphs := {1}'' format: { innerWidget submorphs }) + traceCr. + firstMorphIndex := size - self presenter visiblePages + 1. (''self presenter visiblePages := {1}'' format: { self presenter visiblePages }) traceCr. From 2dc14b98cfee5e17dade064f0adf4f9111026322 Mon Sep 17 00:00:00 2001 From: "adrien.vanegue.etu" Date: Mon, 22 Jan 2024 14:11:05 +0100 Subject: [PATCH 3/5] more traces --- src/BaselineOfNewTools/BaselineOfNewTools.class.st | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/BaselineOfNewTools/BaselineOfNewTools.class.st b/src/BaselineOfNewTools/BaselineOfNewTools.class.st index 8eeb5899..86822d25 100644 --- a/src/BaselineOfNewTools/BaselineOfNewTools.class.st +++ b/src/BaselineOfNewTools/BaselineOfNewTools.class.st @@ -195,13 +195,21 @@ BaselineOfNewTools >> postload: loader package: packageSpec [ | size firstMorphIndex | size := innerWidget submorphs size. (''size := {1}'' format: { size }) traceCr. + (''widget class := {1} '' format: { innerWidget class }) traceCr. (''widget := {1} '' format: { innerWidget }) traceCr. + ''widget submorphs classes := {1}'' format: + { (innerWidget submorphs collect: [ :s | s class ]) }. (''widget submorphs := {1}'' format: { innerWidget submorphs }) traceCr. firstMorphIndex := size - self presenter visiblePages + 1. + (''self presenter := {1}'' format: { self presenter }) traceCr. + (''self presenter class := {1}'' format: { self presenter class }) + traceCr. (''self presenter visiblePages := {1}'' format: { self presenter visiblePages }) traceCr. + (''firstMorphIndex class := {1}'' format: { firstMorphIndex class }) + traceCr. (''firstMorphIndex := {1}'' format: { firstMorphIndex }) traceCr. (''((firstMorphIndex max: 1) min: size) := {1}'' format: { ((firstMorphIndex max: 1) min: size) }) traceCr. From 26d271144086734243b7ff876299f3c3c2bcb9b8 Mon Sep 17 00:00:00 2001 From: "adrien.vanegue.etu" Date: Tue, 23 Jan 2024 09:42:53 +0100 Subject: [PATCH 4/5] adding a fix for SubscriptOutOfBounds. Let us see if it works --- src/BaselineOfNewTools/BaselineOfNewTools.class.st | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BaselineOfNewTools/BaselineOfNewTools.class.st b/src/BaselineOfNewTools/BaselineOfNewTools.class.st index 86822d25..a45190bd 100644 --- a/src/BaselineOfNewTools/BaselineOfNewTools.class.st +++ b/src/BaselineOfNewTools/BaselineOfNewTools.class.st @@ -213,8 +213,9 @@ BaselineOfNewTools >> postload: loader package: packageSpec [ (''firstMorphIndex := {1}'' format: { firstMorphIndex }) traceCr. (''((firstMorphIndex max: 1) min: size) := {1}'' format: { ((firstMorphIndex max: 1) min: size) }) traceCr. - self widget showMorph: - (innerWidget submorphs at: ((firstMorphIndex max: 1) min: size)) ]'; + size > 0 ifTrue: [ + self widget showMorph: + (innerWidget submorphs at: ((firstMorphIndex max: 1) min: size)) ] ]'; install ] From c6f8ef6ce0786d7bd4a2563627d0c6237d25d7d6 Mon Sep 17 00:00:00 2001 From: "adrien.vanegue.etu" Date: Tue, 23 Jan 2024 13:54:19 +0100 Subject: [PATCH 5/5] attempt to fix second Morphic bug --- .../BaselineOfNewTools.class.st | 57 ++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/src/BaselineOfNewTools/BaselineOfNewTools.class.st b/src/BaselineOfNewTools/BaselineOfNewTools.class.st index a45190bd..2c7e54cf 100644 --- a/src/BaselineOfNewTools/BaselineOfNewTools.class.st +++ b/src/BaselineOfNewTools/BaselineOfNewTools.class.st @@ -170,6 +170,59 @@ BaselineOfNewTools >> chest: spec [ loads: 'default' ] ] +{ #category : 'actions' } +BaselineOfNewTools >> compileRubTextSegmentMorph [ + + RubTextSegmentMorph compiler + source: 'computeStraightVertices + + | firstCB lastCB firstLineIndex lastLineIndex firstLine lastLine verts lines textarea margins segmentGap textAreaLeft | + (''firstIndex := {1}'' format: { firstIndex }) traceCr. + (''lastIndex := {1}'' format: { lastIndex }) traceCr. + (''self lines := {1} '' format: { self lines }) traceCr. + self lines ifEmpty: [ ^ self ]. + firstCB := self characterBlockForIndex: firstIndex. + (''firstCB := {1}'' format: { firstCB }) traceCr. + lastCB := self characterBlockForIndex: lastIndex. + (''lastCB := {1}'' format: { lastCB }) traceCr. + lines := self lines. + textarea := self textArea. + margins := self margins. + firstLineIndex := self lineIndexOfCharacterIndex: firstIndex. + lastLineIndex := self lineIndexOfCharacterIndex: lastIndex. + firstLine := lines at: firstLineIndex. + lastLine := lines at: lastLineIndex. + verts := OrderedCollection new. + segmentGap := 1 @ 0. + firstLine = lastLine + ifTrue: [ + verts add: firstCB bottomLeft. + verts add: firstCB topLeft. + firstIndex ~= lastIndex ifTrue: [ + verts add: lastCB topLeft. + verts add: lastCB bottomLeft. + verts add: firstCB bottomLeft ] ] + ifFalse: [ + textAreaLeft := textArea left + margins left. + verts + add: firstCB bottomLeft - segmentGap; + add: firstCB topLeft - segmentGap. + firstLineIndex to: lastLineIndex - 1 do: [ :index | + | line | + line := lines at: index. + verts + add: line actualWidth + margins left @ line top + segmentGap; + add: line actualWidth + margins left @ line bottom + segmentGap ]. + + verts + add: lastCB topLeft + segmentGap; + add: lastCB bottomLeft + segmentGap; + add: textAreaLeft @ lastLine bottom - segmentGap; + add: textAreaLeft @ firstLine bottom - segmentGap ]. + self setVertices: verts'; + install +] + { #category : 'accessing' } BaselineOfNewTools >> packageRepositoryURLForSpec: spec [ | url | @@ -216,7 +269,9 @@ BaselineOfNewTools >> postload: loader package: packageSpec [ size > 0 ifTrue: [ self widget showMorph: (innerWidget submorphs at: ((firstMorphIndex max: 1) min: size)) ] ]'; - install + install. + + self compileRubTextSegmentMorph ] { #category : 'actions' }