GRAPHICS: Prevent crash when drawing 0-height rounded corners
Opening/closing the console when scroll bars were visible caused occasional crashes. Fixes #7089.
This commit is contained in:
parent
a2250d74ed
commit
9b69b86f29
1 changed files with 3 additions and 2 deletions
|
@ -2256,6 +2256,9 @@ drawBorderRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color,
|
||||||
template<typename PixelType>
|
template<typename PixelType>
|
||||||
void VectorRendererAA<PixelType>::
|
void VectorRendererAA<PixelType>::
|
||||||
drawInteriorRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m) {
|
drawInteriorRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m) {
|
||||||
|
w -= 2*Base::_strokeWidth;
|
||||||
|
h -= 2*Base::_strokeWidth;
|
||||||
|
|
||||||
// Do not draw empty space rounded squares.
|
// Do not draw empty space rounded squares.
|
||||||
if (w <= 0 || h <= 0) {
|
if (w <= 0 || h <= 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -2272,8 +2275,6 @@ drawInteriorRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType colo
|
||||||
r -= Base::_strokeWidth;
|
r -= Base::_strokeWidth;
|
||||||
x1 += Base::_strokeWidth;
|
x1 += Base::_strokeWidth;
|
||||||
y1 += Base::_strokeWidth;
|
y1 += Base::_strokeWidth;
|
||||||
w -= 2*Base::_strokeWidth;
|
|
||||||
h -= 2*Base::_strokeWidth;
|
|
||||||
rsq = r*r;
|
rsq = r*r;
|
||||||
|
|
||||||
PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r);
|
PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue