diff --git a/repository/OpenPonk-ClassEditor/OPRSCairoMetricsProvider.class.st b/repository/OpenPonk-ClassEditor/OPRSCairoMetricsProvider.class.st new file mode 100644 index 00000000..650372ed --- /dev/null +++ b/repository/OpenPonk-ClassEditor/OPRSCairoMetricsProvider.class.st @@ -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 +] diff --git a/repository/OpenPonk-ClassEditor/OPUmlClassifierNameLabel.class.st b/repository/OpenPonk-ClassEditor/OPUmlClassifierNameLabel.class.st index b0b6e93f..2fc39d1c 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlClassifierNameLabel.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlClassifierNameLabel.class.st @@ -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 ]