Skip to content

Commit

Permalink
Fix clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 14, 2022
1 parent 38c297e commit 143a23c
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/core/labeling/qgstextlabelfeature.cpp
Expand Up @@ -112,6 +112,7 @@ QgsPrecalculatedTextMetrics QgsTextLabelFeature::calculateTextMetrics( const Qgs
break;

case Qgis::TextCharacterVerticalAlignment::SuperScript:
case Qgis::TextCharacterVerticalAlignment::SubScript:
{
if ( graphemeFormat->fontPointSize() < 0 )
{
Expand All @@ -120,17 +121,7 @@ QgsPrecalculatedTextMetrics QgsTextLabelFeature::calculateTextMetrics( const Qgs
// the superscript in a smaller font size. BUT if the fragment format HAS a non -1 font size then it indicates
// that the document has an explicit font size for the super/subscript element, eg "my text<sup style="font-size: 6pt">2</sup>"
// which we should respect
graphemeFont.setPixelSize( graphemeFont.pixelSize() * SUPERSCRIPT_SUBSCRIPT_FONT_SIZE_SCALING_FACTOR );
}
break;
}

case Qgis::TextCharacterVerticalAlignment::SubScript:
{
if ( graphemeFormat->fontPointSize() < 0 )
{
// see above!!
graphemeFont.setPixelSize( graphemeFont.pixelSize() * SUPERSCRIPT_SUBSCRIPT_FONT_SIZE_SCALING_FACTOR );
graphemeFont.setPixelSize( static_cast< int >( std::round( graphemeFont.pixelSize() * SUPERSCRIPT_SUBSCRIPT_FONT_SIZE_SCALING_FACTOR ) ) );
}
break;
}
Expand Down

0 comments on commit 143a23c

Please sign in to comment.