diff --git a/src/servers/app/drawing/Painter/Painter.cpp b/src/servers/app/drawing/Painter/Painter.cpp index e2b0e005d6..18729ab56c 100644 --- a/src/servers/app/drawing/Painter/Painter.cpp +++ b/src/servers/app/drawing/Painter/Painter.cpp @@ -903,7 +903,7 @@ Painter::FillRect(const BRect& r, const BGradient& gradient) const if (gradient.GetType() == BGradient::TYPE_LINEAR && (fDrawingMode == B_OP_COPY || fDrawingMode == B_OP_OVER)) { const BGradientLinear* linearGradient - = static_cast(&gradient); + = dynamic_cast(&gradient); if (linearGradient->Start().x == linearGradient->End().x // TODO: Remove this second check once the optimized method // handled "upside down" gradients as well...