diff --git a/melatonin/components/overlay.h b/melatonin/components/overlay.h index 6bb48d8..6904f22 100644 --- a/melatonin/components/overlay.h +++ b/melatonin/components/overlay.h @@ -351,7 +351,7 @@ namespace melatonin void drawDimensionsLabel() { - int labelWidth = (int) dimensions.getFont().getStringWidthFloat (dimensionsString (selectedBounds)) + 15; + int labelWidth = (int) juce::GlyphArrangement::getStringWidth ( dimensions.getFont(), dimensionsString (selectedBounds)) + 15; int labelHeight = 15; auto paddingToLabel = 4; auto labelCenterX = selectedBounds.getX() + selectedBounds.getWidth() / 2; @@ -413,7 +413,7 @@ namespace melatonin // top if (lineToTopHoveredComponent.getLength() > 0) { - int labelWidth = (int) distanceToTopHoveredLabel.getFont().getStringWidthFloat (distanceString (lineToTopHoveredComponent)) + 15; + int labelWidth = (int) juce::GlyphArrangement::getStringWidth ( distanceToTopHoveredLabel.getFont(), distanceString (lineToTopHoveredComponent)) + 15; // todo draw on left or right side of line auto labelCenterY = lineToTopHoveredComponent.getPointAlongLineProportionally (0.5f).getY(); @@ -429,7 +429,7 @@ namespace melatonin // bottom if (lineToBottomHoveredComponent.getLength() > 0) { - int labelWidth = (int) distanceToBottomHoveredLabel.getFont().getStringWidthFloat (distanceString (lineToBottomHoveredComponent)) + 15; + int labelWidth = (int) juce::GlyphArrangement::getStringWidth ( distanceToBottomHoveredLabel.getFont(), distanceString (lineToBottomHoveredComponent)) + 15; // todo draw on left or right side of line auto labelCenterY = lineToBottomHoveredComponent.getPointAlongLineProportionally (0.5f).getY(); @@ -445,7 +445,7 @@ namespace melatonin // right if (lineToRightHoveredComponent.getLength() > 0) { - int labelWidth = (int) distanceToRightHoveredLabel.getFont().getStringWidthFloat (distanceString (lineToRightHoveredComponent)) + 15; + int labelWidth = (int) juce::GlyphArrangement::getStringWidth ( distanceToRightHoveredLabel.getFont(), distanceString (lineToRightHoveredComponent)) + 15; // todo draw on top or bottom side of line auto labelCenterX = lineToRightHoveredComponent.getPointAlongLineProportionally (0.5f).getX(); @@ -461,7 +461,7 @@ namespace melatonin // left if (lineToLeftHoveredComponent.getLength() > 0) { - int labelWidth = (int) distanceToLeftHoveredLabel.getFont().getStringWidthFloat (distanceString (lineToLeftHoveredComponent)) + 15; + int labelWidth = (int) juce::GlyphArrangement::getStringWidth ( distanceToLeftHoveredLabel.getFont(), distanceString (lineToLeftHoveredComponent)) + 15; // todo draw on top or bottom side of line auto labelCenterX = lineToLeftHoveredComponent.getPointAlongLineProportionally (0.5f).getX(); diff --git a/melatonin/lookandfeel.h b/melatonin/lookandfeel.h index 293555a..edda5d6 100644 --- a/melatonin/lookandfeel.h +++ b/melatonin/lookandfeel.h @@ -164,7 +164,7 @@ namespace melatonin if (component.getProperties().getWithDefault ("isUserProperty", false)) { - auto textWidth = (float) g.getCurrentFont().getStringWidth (component.getName()); + auto textWidth = (float) juce::GlyphArrangement::getStringWidth ( g.getCurrentFont(), component.getName()); auto tagBounds = juce::Rectangle (3 + textWidth + 3, 7, 40, 14).toFloat(); g.setColour (colors::panelBackgroundDarker); g.fillRoundedRectangle (tagBounds, 3);