From f71fb107fc724e58517e9a3837d54159d0c381de Mon Sep 17 00:00:00 2001 From: saschawillems Date: Tue, 7 Mar 2017 21:51:56 +0100 Subject: [PATCH] Added font scaling factor to text overlay class --- base/vulkantextoverlay.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/base/vulkantextoverlay.hpp b/base/vulkantextoverlay.hpp index faf2ad07..2325c4b4 100644 --- a/base/vulkantextoverlay.hpp +++ b/base/vulkantextoverlay.hpp @@ -81,6 +81,8 @@ public: bool visible = true; bool invalidated = false; + float scale = 1.0f; + std::vector cmdBuffers; /** @@ -551,8 +553,14 @@ public: { assert(vertexBuffer.mapped != nullptr); - const float charW = 1.5f / *frameBufferWidth; - const float charH = 1.5f / *frameBufferHeight; + if (align == alignLeft) { + x *= scale; + }; + + y *= scale; + + const float charW = (1.5f * scale) / *frameBufferWidth; + const float charH = (1.5f * scale) / *frameBufferHeight; float fbW = (float)*frameBufferWidth; float fbH = (float)*frameBufferHeight;