Skip to content

Commit

Permalink
Merge pull request #338 from pharo-graphics/dontPositionOnAsForm
Browse files Browse the repository at this point in the history
Fix: Converting to Form was cropped when position is not zero
  • Loading branch information
tinchodias authored Oct 25, 2023
2 parents 203b85f + 2e40b8e commit afb6e61
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Bloc-Alexandrie/BlElement.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BlElement >> aeAsForm [
self isLayoutRequested ifTrue: [ self forceLayout ].

"We want to consider our border, effect, as well as children's."
invalidationBounds := self invalidationBounds: BlBounds new.
invalidationBounds := self invalidationBoundsInSpace.
aCanvas := AeCanvas extent: invalidationBounds extent.
aCanvas pathTranslate: invalidationBounds origin negated.
self aeFullDrawOn: aCanvas.
Expand Down
22 changes: 22 additions & 0 deletions src/Bloc-UnitedTests/BlBasicTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@ Class {
#category : #'Bloc-UnitedTests-Basic'
}

{ #category : #tests }
BlBasicTest >> testAsForm [

| anElement |
anElement := BlElement new
size: 30@40;
background: Color green;
yourself.

self assert: anElement asForm extent equals: 30@40.

anElement position: 10@20.
self assert: anElement asForm extent equals: 30@40.

anElement transformDo: [ :t | t scaleBy: 2@3 ].
self assert: anElement asForm extent equals: 60@120.

self
assert: (anElement asForm colorAt: 0@0)
equals: Color green
]

{ #category : #tests }
BlBasicTest >> testBorderRopedText [
<sampleInstance>
Expand Down

0 comments on commit afb6e61

Please sign in to comment.