From bd783d319557b41b5865d51f306a74abbf7af18c Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Wed, 21 Jun 2023 00:59:41 +1000 Subject: make the chat really pretty!! also slightly optimized text shadow rendering, made sure glyphs with directives stay centered and added two extra Lua arguments to canvas.drawText --- source/windowing/StarCanvasWidget.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/windowing/StarCanvasWidget.cpp') diff --git a/source/windowing/StarCanvasWidget.cpp b/source/windowing/StarCanvasWidget.cpp index 3e58802..d0c6999 100644 --- a/source/windowing/StarCanvasWidget.cpp +++ b/source/windowing/StarCanvasWidget.cpp @@ -60,8 +60,8 @@ void CanvasWidget::drawTriangles(List> const& triangl m_renderOps.append(make_tuple(triangles, color)); } -void CanvasWidget::drawText(String s, TextPositioning position, unsigned fontSize, Vec4B const& color, FontMode mode, float lineSpacing) { - m_renderOps.append(make_tuple(move(s), move(position), fontSize, color, mode, lineSpacing)); +void CanvasWidget::drawText(String s, TextPositioning position, unsigned fontSize, Vec4B const& color, FontMode mode, float lineSpacing, String processingDirectives) { + m_renderOps.append(make_tuple(move(s), move(position), fontSize, color, mode, lineSpacing, move(processingDirectives))); } Vec2I CanvasWidget::mousePosition() const { @@ -137,7 +137,7 @@ void CanvasWidget::renderImpl() { if (auto args = op.ptr()) tupleUnpackFunction(bind(&CanvasWidget::renderTriangles, this, renderingOffset, _1, _2), *args); if (auto args = op.ptr()) - tupleUnpackFunction(bind(&CanvasWidget::renderText, this, renderingOffset, _1, _2, _3, _4, _5, _6), *args); + tupleUnpackFunction(bind(&CanvasWidget::renderText, this, renderingOffset, _1, _2, _3, _4, _5, _6, _7), *args); } } @@ -222,8 +222,9 @@ void CanvasWidget::renderTriangles(Vec2F const& renderingOffset, List