Skip to content

Commit

Permalink
Fixed char-width bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RMichelsen committed Sep 7, 2020
1 parent c6bc896 commit 471b93a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ void DrawGridLine(Renderer *renderer, int row) {
// Add spacing for unicode chars. These characters are still single char width,
// but some of them by default will take up a bit more or less, leading to issues.
// So we realign them here.
if(renderer->grid_chars[base + i] > 0xFF) {
else if(renderer->grid_chars[base + i] > 0xFF) {
float char_width = GetTextWidth(renderer, &renderer->grid_chars[base + i], 1);
if(abs(char_width - renderer->font_width) > 0.01f) {
DWRITE_TEXT_RANGE range { .startPosition = static_cast<uint32_t>(i), .length = 1 };
Expand Down

0 comments on commit 471b93a

Please sign in to comment.