Skip to content

Commit

Permalink
demo app: fix alignments
Browse files Browse the repository at this point in the history
  • Loading branch information
inanevin committed May 2, 2024
1 parent e1ba259 commit 86767f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ add_library(Lina::VG ALIAS ${PROJECT_NAME})
#--------------------------------------------------------------------

target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/include)
target_compile_definitions(${PROJECT_NAME} PUBLIC LINAVG_VERSION_MAJOR=1)
target_compile_definitions(${PROJECT_NAME} PUBLIC LINAVG_VERSION_MINOR=6)
target_compile_definitions(${PROJECT_NAME} PUBLIC LINAVG_VERSION_PATCH=9)
target_compile_definitions(${PROJECT_NAME} PUBLIC LINAVG_VERSION_MAJOR=2)
target_compile_definitions(${PROJECT_NAME} PUBLIC LINAVG_VERSION_MINOR=0)
target_compile_definitions(${PROJECT_NAME} PUBLIC LINAVG_VERSION_PATCH=1)

#--------------------------------------------------------------------
# Subdirectories & linking
Expand Down
9 changes: 5 additions & 4 deletions Example/src/DemoScreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ namespace LinaVG
TextOptions descText;
descText.font = fontDesc;
descText.wrapWidth = rectWidth * 0.45f;
ExampleApp::Get()->GetLVGDrawer().DrawTextNormal(m_screenDescriptions[ExampleApp::Get()->GetCurrentScreen() - 1].c_str(), Vec2(rectWidth * 0.25f, rectMin.y + 30), descText, 0, 4);
const Vec2 sz = ExampleApp::Get()->GetLVGDrawer().CalculateTextSize(m_screenDescriptions[ExampleApp::Get()->GetCurrentScreen() - 1].c_str(), descText);
ExampleApp::Get()->GetLVGDrawer().DrawTextNormal(m_screenDescriptions[ExampleApp::Get()->GetCurrentScreen() - 1].c_str(), Vec2(rectWidth * 0.25f, rectMin.y + sz.y + 10), descText, 0, 4);

// Draw version text.
TextOptions versionText;
Expand Down Expand Up @@ -688,7 +689,7 @@ namespace LinaVG
ExampleApp::Get()->GetLVGDrawer().DrawTextNormal("Gradient color.", startPos, textOpts, m_rotateAngle, 1);

startPos.x = screenSize.x * 0.05f;
startPos.y += 50;
startPos.y += 350;
textOpts.wrapWidth = 100;
textOpts.dropShadowColor = Vec4(1, 0, 0, 1);
textOpts.color = Vec4(1, 1, 1, 1);
Expand All @@ -713,7 +714,7 @@ namespace LinaVG
ExampleApp::Get()->GetLVGDrawer().DrawTextNormal("Same, but it's right alignment", startPos, textOpts, m_rotateAngle, 1);

startPos.x = screenSize.x * 0.05f;
startPos.y += 370;
startPos.y += 50;
textOpts.spacing = 10;
textOpts.wrapWidth = 0.0f;
textOpts.alignment = TextAlignment::Left;
Expand All @@ -722,7 +723,7 @@ namespace LinaVG

startPos.y += 70;
startPos.x = screenSize.x * 0.05f;
const float beforeSDFStartPos = startPos.y;
const float beforeSDFStartPos = startPos.y + 200;
SDFTextOptions sdfOpts;
sdfOpts.font = fontSDF;
sdfOpts.sdfThickness = 0.55f;
Expand Down

0 comments on commit 86767f6

Please sign in to comment.