[core] Use floats instead of ints for Shaping.
Brings gl-native shaping closer to gl-js.
This commit is contained in:
@@ -75,10 +75,10 @@ class Shaping {
|
||||
explicit Shaping(float x, float y, WritingModeType writingMode_)
|
||||
: top(y), bottom(y), left(x), right(x), writingMode(writingMode_) {}
|
||||
std::vector<PositionedGlyph> positionedGlyphs;
|
||||
int32_t top = 0;
|
||||
int32_t bottom = 0;
|
||||
int32_t left = 0;
|
||||
int32_t right = 0;
|
||||
float top = 0;
|
||||
float bottom = 0;
|
||||
float left = 0;
|
||||
float right = 0;
|
||||
WritingModeType writingMode;
|
||||
|
||||
explicit operator bool() const { return !positionedGlyphs.empty(); }
|
||||
|
||||
@@ -313,7 +313,7 @@ void shapeLines(Shaping& shaping,
|
||||
|
||||
align(shaping, justify, anchorAlign.horizontalAlign, anchorAlign.verticalAlign, maxLineLength,
|
||||
lineHeight, lines.size());
|
||||
const uint32_t height = lines.size() * lineHeight;
|
||||
const float height = lines.size() * lineHeight;
|
||||
|
||||
// Calculate the bounding box
|
||||
shaping.top += -anchorAlign.verticalAlign * height;
|
||||
|
||||
Reference in New Issue
Block a user