Skip to content

Commit

Permalink
Merge pull request #54 from pharo-graphics/speedup
Browse files Browse the repository at this point in the history
Reimplement some explicitly required methods to speed up shapes
  • Loading branch information
tesonep authored Feb 19, 2024
2 parents ce9cb96 + 8dd84fd commit 2e7ff9f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Roassal-Shapes/RSBoundingShape.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,20 @@ RSBoundingShape >> defaultExtent [
^ 10@10
]

{ #category : 'accessing' }
RSBoundingShape >> encompassingRectangle [
"This is to replace the #explicitRequirement and be faster."

^ super encompassingRectangle
]

{ #category : 'accessing' }
RSBoundingShape >> extent [
"This is to replace the #explicitRequirement and be faster."

^ super extent
]

{ #category : 'accessing' }
RSBoundingShape >> extent: aPoint [
| oldExtent extent delta |
Expand Down Expand Up @@ -220,6 +234,13 @@ RSBoundingShape >> hasLines [
^ connectedLines isNotNil
]

{ #category : 'accessing' }
RSBoundingShape >> height [
"This is to replace the #explicitRequirement and be faster."

^ super height
]

{ #category : 'accessing' }
RSBoundingShape >> height: aNumber [
self extent: self extent x @ aNumber
Expand Down Expand Up @@ -661,6 +682,13 @@ RSBoundingShape >> updateLinesON [
shouldUpdateLines := true
]

{ #category : 'accessing' }
RSBoundingShape >> width [
"This is to replace the #explicitRequirement and be faster."

^ super width
]

{ #category : 'accessing' }
RSBoundingShape >> width: aNumber [
self extent: aNumber @ self extent y
Expand Down

0 comments on commit 2e7ff9f

Please sign in to comment.