From 991dc5efa63ebb7a5e2f1bfe4b1afb1f58e8e324 Mon Sep 17 00:00:00 2001 From: Martin Dias Date: Wed, 4 Sep 2024 19:18:03 -0400 Subject: [PATCH 1/2] Do not consider that the AeCanvas has default dash array set Regression test PNG incoming in next commit --- .../BlSpaceFixture.class.st | 35 +++++++++++++++++++ src/Bloc-Alexandrie/BlBorder.extension.st | 6 ++-- .../BlTextBorderAttribute.extension.st | 7 ++-- 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/Bloc-Alexandrie-Tests/BlSpaceFixture.class.st b/src/Bloc-Alexandrie-Tests/BlSpaceFixture.class.st index f41fa97e9..9bb52813c 100644 --- a/src/Bloc-Alexandrie-Tests/BlSpaceFixture.class.st +++ b/src/Bloc-Alexandrie-Tests/BlSpaceFixture.class.st @@ -114,6 +114,41 @@ BlSpaceFixture >> buildCapRoundDashedBorderOnClosedGeometry [ ] +{ #category : #fixtures } +BlSpaceFixture >> buildChildDoesntInheritDashedBorder [ + + | outskirts | + builder spaceExtent: 90 @ 50. + builder space root layout: BlFlowLayout horizontal. + + outskirts := { + BlOutskirts centered. + BlOutskirts inside. + BlOutskirts outside }. + + #(true false) do: [ :childHasBorder | + outskirts do: [ :eachOutskirt | + | parent child | + parent := builder addToRoot + size: 25 @ 20; + margin: (BlInsets all: 2.5); + outskirts: eachOutskirt; + layout: BlFrameLayout new; + border: (BlBorder builder + paint: Color blue; + width: 2; + dashArray: #(2 2); + build). + child := (builder addTo: parent) + size: 12 asPoint; + constraintsDo: [ :c | + c frame horizontal alignCenter. + c frame vertical alignCenter ]. + childHasBorder ifTrue: [ + child border: (BlBorder paint: Color white width: 4) ] ] ] + +] + { #category : #fixtures } BlSpaceFixture >> buildClippingAbsolutelyTransparentElement [ "Add 3 elements, where only the last one should be clipped by it's transparent parent. diff --git a/src/Bloc-Alexandrie/BlBorder.extension.st b/src/Bloc-Alexandrie/BlBorder.extension.st index 3e4148356..5076a02ca 100644 --- a/src/Bloc-Alexandrie/BlBorder.extension.st +++ b/src/Bloc-Alexandrie/BlBorder.extension.st @@ -20,9 +20,9 @@ BlBorder >> aeApplyTo: aeCanvas element: aBlElement [ aeCanvas setBorderBlock: [ paint aeApplyTo: aeCanvas. - "No dashes is the default" - style dashArray ifNotEmpty: [ :da | - aeCanvas setDashes: da offset: style dashOffset ]. + aeCanvas + setDashes: style dashArray + offset: style dashOffset. aBlElement geometry hasJoins ifTrue: [ style lineJoin diff --git a/src/Bloc-Alexandrie/BlTextBorderAttribute.extension.st b/src/Bloc-Alexandrie/BlTextBorderAttribute.extension.st index 5192ed247..893b50e97 100644 --- a/src/Bloc-Alexandrie/BlTextBorderAttribute.extension.st +++ b/src/Bloc-Alexandrie/BlTextBorderAttribute.extension.st @@ -28,10 +28,9 @@ BlTextBorderAttribute >> aeDrawOn: aeCanvas span: aBASpan [ aeCanvas setBorderBlock: [ border paint aeApplyTo: aeCanvas. - border style dashArray ifNotEmpty: [ :da | - aeCanvas - setDashes: da - offset: border style dashOffset ]. + aeCanvas + setDashes: border style dashArray + offset: border style dashOffset. border style lineJoin aeApplyTo: aeCanvas From fd95f9c324dfc863e87d0bf53cfaea48f631570b Mon Sep 17 00:00:00 2001 From: Martin Dias Date: Wed, 4 Sep 2024 19:22:03 -0400 Subject: [PATCH 2/2] Add PNGs for regression tests --- .../hit/buildChildDoesntInheritDashedBorder.png | Bin 0 -> 274 bytes .../buildChildDoesntInheritDashedBorder.png | Bin 0 -> 1116 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/hit/buildChildDoesntInheritDashedBorder.png create mode 100644 tests/render/buildChildDoesntInheritDashedBorder.png diff --git a/tests/hit/buildChildDoesntInheritDashedBorder.png b/tests/hit/buildChildDoesntInheritDashedBorder.png new file mode 100644 index 0000000000000000000000000000000000000000..13e30a382ba1f458d8b7577d8f4c3b8fca215389 GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^Q9x|O!3HGn@SiaSQa3$a978JNp58po$)L!?a$&8a z>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