Skip to content

Commit

Permalink
Reimplement some explicitly required methods to speed up shapes
Browse files Browse the repository at this point in the history
#explicitRequirement is really slow in the case were a method is implemented already in the superclass and this slow down a lot some visualizations. I propose to explicitly define the super call to get a huge speed up on shapes (This allows to save a lot of times in the Moose visualizations)
  • Loading branch information
jecisc committed Jan 30, 2024
1 parent ce9cb96 commit 8dd84fd
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 8dd84fd

Please sign in to comment.