1
0
Fork 0

Fix #10477: Not enough space for text due to rounding down (OSX) (#10489)

pull/10628/head
PeterN 2023-02-18 10:50:20 +00:00 committed by rubidium42
parent 0604f571e1
commit addf30ecdf
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@
#include "../../fontcache.h" #include "../../fontcache.h"
#include "../../zoom_func.h" #include "../../zoom_func.h"
#include "macos.h" #include "macos.h"
#include <cmath>
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
@ -253,7 +254,7 @@ CoreTextParagraphLayout::CoreTextVisualRun::CoreTextVisualRun(CTRunRef run, Font
this->positions[i * 2 + 1] = pts[i].y; this->positions[i * 2 + 1] = pts[i].y;
} }
} }
this->total_advance = (int)CTRunGetTypographicBounds(run, CFRangeMake(0, 0), nullptr, nullptr, nullptr); this->total_advance = (int)std::ceil(CTRunGetTypographicBounds(run, CFRangeMake(0, 0), nullptr, nullptr, nullptr));
this->positions[this->glyphs.size() * 2] = this->positions[0] + this->total_advance; this->positions[this->glyphs.size() * 2] = this->positions[0] + this->total_advance;
} }