Skip to content

Commit

Permalink
長方形内のテキスト描画でドットの間隔がフォントサイズによって変わる問題を修正 (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raclamusi authored Nov 17, 2024
1 parent 9bdeaf3 commit 4a11000
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Siv3D/src/Siv3D/Font/GlyphCache/BitmapGlyphCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ namespace s3d
}
updateTexture();

const double dotXAdvance = m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance;
const Vec2 areaBottomRight = area.br();

const auto& prop = font.getProperty();
const double scale = (size / prop.fontPixelSize);
const double lineHeight = (prop.height() * scale * lineHeightScale);
const double dotXAdvance = (m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance * scale);

if ((area.w < (dotXAdvance * 3)) || (area.h < lineHeight))
{
Expand Down Expand Up @@ -220,12 +220,12 @@ namespace s3d
}
updateTexture();

const double dotXAdvance = m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance;
const Vec2 areaBottomRight = area.br();

const auto& prop = font.getProperty();
const double scale = (size / prop.fontPixelSize);
const double lineHeight = (prop.height() * scale * lineHeightScale);
const double dotXAdvance = (m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance * scale);

if ((area.w < (dotXAdvance * 3)) || (area.h < lineHeight))
{
Expand Down
4 changes: 2 additions & 2 deletions Siv3D/src/Siv3D/Font/GlyphCache/MSDFGlyphCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ namespace s3d
}
updateTexture();

const double dotXAdvance = m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance;
const Vec2 areaBottomRight = area.br();

const auto& prop = font.getProperty();
const double scale = (size / prop.fontPixelSize);
const double lineHeight = (prop.height() * scale * lineHeightScale);
const double dotXAdvance = (m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance * scale);

if ((area.w < (dotXAdvance * 3)) || (area.h < lineHeight))
{
Expand Down Expand Up @@ -219,12 +219,12 @@ namespace s3d
}
updateTexture();

const double dotXAdvance = m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance;
const Vec2 areaBottomRight = area.br();

const auto& prop = font.getProperty();
const double scale = (size / prop.fontPixelSize);
const double lineHeight = (prop.height() * scale * lineHeightScale);
const double dotXAdvance = (m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance * scale);

if ((area.w < (dotXAdvance * 3)) || (area.h < lineHeight))
{
Expand Down
4 changes: 2 additions & 2 deletions Siv3D/src/Siv3D/Font/GlyphCache/SDFGlyphCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ namespace s3d
}
updateTexture();

const double dotXAdvance = m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance;
const Vec2 areaBottomRight = area.br();

const auto& prop = font.getProperty();
const double scale = (size / prop.fontPixelSize);
const double lineHeight = (prop.height() * scale * lineHeightScale);
const double dotXAdvance = (m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance * scale);

if ((area.w < (dotXAdvance * 3)) || (area.h < lineHeight))
{
Expand Down Expand Up @@ -219,12 +219,12 @@ namespace s3d
}
updateTexture();

const double dotXAdvance = m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance;
const Vec2 areaBottomRight = area.br();

const auto& prop = font.getProperty();
const double scale = (size / prop.fontPixelSize);
const double lineHeight = (prop.height() * scale * lineHeightScale);
const double dotXAdvance = (m_glyphTable.find(dotGlyphCluster[0].glyphIndex)->second.info.xAdvance * scale);

if ((area.w < (dotXAdvance * 3)) || (area.h < lineHeight))
{
Expand Down

0 comments on commit 4a11000

Please sign in to comment.