Skip to content

Commit

Permalink
Added a hack for wrong text width with emphasis
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Oct 3, 2024
1 parent b751462 commit 576c3f2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
22 changes: 22 additions & 0 deletions repository/OpenPonk-ClassEditor/OPRSCairoMetricsProvider.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Class {
#name : 'OPRSCairoMetricsProvider',
#superclass : 'RSCairoMetricsProvider',
#category : 'OpenPonk-ClassEditor-Shapes',
#package : 'OpenPonk-ClassEditor',
#tag : 'Shapes'
}

{ #category : 'hooks' }
OPRSCairoMetricsProvider >> extentsOf: aRSLabel [
"This entire class exists to overcome
https://github.com/pharo-graphics/Roassal/issues/64"

| copy |
self flag: 'https://github.com/pharo-graphics/Roassal/issues/64'.
aRSLabel isNormal ifTrue: [ ^ super extentsOf: aRSLabel ].
copy := RSLabel new
font: aRSLabel font;
text: aRSLabel text , '.';
yourself.
^ copy textExtents
]
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,10 @@ OPUmlClassifierNameLabel >> updateRenderFromModel [

roassalShape := labeled labelShape.

roassalShape shapes do: [ :each |
self flag: 'https://github.com/pharo-graphics/Roassal/issues/64'.
each metricsProvider: OPRSCairoMetricsProvider new ].
roassalShape adjustToChildren.

roassalShape signalUpdate
]

0 comments on commit 576c3f2

Please sign in to comment.