renderer: ++null check

fixed a Duplicate example crash, regression by:
f06127ab93
This commit is contained in:
Hermet Park 2024-07-16 00:43:15 +09:00
parent 03b36cea7b
commit 3cb7aecb6a

View file

@ -125,8 +125,8 @@ struct Text::Impl
if (!load()) return nullptr;
//transform the gradient coordinates based on the final scaled font.
if (P(paint)->flag & RenderUpdateFlag::Gradient) {
auto fill = P(paint)->rs.fill;
auto fill = P(paint)->rs.fill;
if (fill && P(paint)->flag & RenderUpdateFlag::Gradient) {
auto scale = 1.0f / loader->scale;
if (fill->type() == Type::LinearGradient) {
P(static_cast<LinearGradient*>(fill))->x1 *= scale;