diff --git a/src/Text/Test/RendererGLTest.cpp b/src/Text/Test/RendererGLTest.cpp index 7822b74ab..26be89dcf 100644 --- a/src/Text/Test/RendererGLTest.cpp +++ b/src/Text/Test/RendererGLTest.cpp @@ -264,7 +264,7 @@ void RendererGLTest::mutableText() { void RendererGLTest::multiline() { class Layouter: public Text::AbstractLayouter { public: - explicit Layouter(UnsignedInt glyphs): AbstractLayouter(glyphs) {} + explicit Layouter(UnsignedInt glyphCount): AbstractLayouter(glyphCount) {} private: std::tuple doRenderGlyph(UnsignedInt) override { @@ -284,7 +284,7 @@ void RendererGLTest::multiline() { std::pair doOpenFile(const std::string&, Float) { _opened = true; - return {0, 3.0f}; + return {0.5f, 0.75f}; } UnsignedInt doGlyphId(char32_t) override { return 0; } @@ -303,7 +303,12 @@ void RendererGLTest::multiline() { std::vector indices; std::vector positions, textureCoordinates; std::tie(positions, textureCoordinates, indices, rectangle) = Text::Renderer2D::render(font, - *static_cast(nullptr), 0.0f, "abcd\nef\n\nghi", Alignment::MiddleCenter); + *static_cast(nullptr), 2.0f, "abcd\nef\n\nghi", Alignment::MiddleCenter); + + /* We're rendering text at 2.0f size and the font is scaled to 0.3f, so the + line advance should be 0.75f*2.0f/0.5f = 3.0f */ + CORRADE_COMPARE(font.size(), 0.5f); + CORRADE_COMPARE(font.lineHeight(), 0.75f); /* Bounds */ CORRADE_COMPARE(rectangle, Range2D({-3.5f, -5.0f}, {3.5f, 5.0f}));