diff options
Diffstat (limited to 'win32/SurfaceD2D.cxx')
-rw-r--r-- | win32/SurfaceD2D.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/win32/SurfaceD2D.cxx b/win32/SurfaceD2D.cxx index fa8383a84..223d35fcf 100644 --- a/win32/SurfaceD2D.cxx +++ b/win32/SurfaceD2D.cxx @@ -1382,7 +1382,8 @@ HRESULT MeasurePositions(TextPositions &poses, const TextWide &tbuf, IDWriteText int ti=0; for (unsigned int ci=0; ci<count; ci++) { for (unsigned int inCluster=0; inCluster<clusterMetrics[ci].length; inCluster++) { - poses.buffer[ti++] = position + clusterMetrics[ci].width * (inCluster + 1) / clusterMetrics[ci].length; + const float proportion = static_cast<float>(inCluster + 1) / clusterMetrics[ci].length; + poses.buffer[ti++] = position + clusterMetrics[ci].width * proportion; } position += clusterMetrics[ci].width; } |