From 1ef614fe7949c7b632035a1f4b20e59f5b241c00 Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Tue, 27 Sep 2022 17:44:58 +0900 Subject: [PATCH] Prevent render of outline, shadow when transparent Change-Id: I2b154228fd5338053aefe66606cfe08135c42c44 Signed-off-by: Bowon Ryu --- dali-toolkit/internal/text/rendering/text-typesetter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dali-toolkit/internal/text/rendering/text-typesetter.cpp b/dali-toolkit/internal/text/rendering/text-typesetter.cpp index 5543d79..467b80e 100644 --- a/dali-toolkit/internal/text/rendering/text-typesetter.cpp +++ b/dali-toolkit/internal/text/rendering/text-typesetter.cpp @@ -974,7 +974,8 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect { // Generate the outline if enabled const uint16_t outlineWidth = mModel->GetOutlineWidth(); - if(outlineWidth != 0u && RENDER_OVERLAY_STYLE != behaviour) + const float outlineAlpha = mModel->GetOutlineColor().a; + if(outlineWidth != 0u && fabsf(outlineAlpha) > Math::MACHINE_EPSILON_1 && RENDER_OVERLAY_STYLE != behaviour) { // Create the image buffer for outline Devel::PixelBuffer outlineImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_OUTLINE, ignoreHorizontalAlignment, pixelFormat, penX, penY, startIndexOfGlyphs, endIndexOfGlyphs); @@ -987,7 +988,8 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect // Generate the shadow if enabled const Vector2& shadowOffset = mModel->GetShadowOffset(); - if(RENDER_OVERLAY_STYLE != behaviour && (fabsf(shadowOffset.x) > Math::MACHINE_EPSILON_1 || fabsf(shadowOffset.y) > Math::MACHINE_EPSILON_1)) + const float shadowAlpha = mModel->GetShadowColor().a; + if(RENDER_OVERLAY_STYLE != behaviour && fabsf(shadowAlpha) > Math::MACHINE_EPSILON_1 && (fabsf(shadowOffset.x) > Math::MACHINE_EPSILON_1 || fabsf(shadowOffset.y) > Math::MACHINE_EPSILON_1)) { // Create the image buffer for shadow Devel::PixelBuffer shadowImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_SHADOW, ignoreHorizontalAlignment, pixelFormat, penX, penY, startIndexOfGlyphs, endIndexOfGlyphs); -- 2.7.4