Commit a42d7a27 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Fixed rendering artifact in glow_draw when rendering a filled polygon.

parent dd129da5
...@@ -1206,14 +1206,14 @@ int GlowDrawQt::polyline_helper(GlowWind* wind, int painter_type, int size, ...@@ -1206,14 +1206,14 @@ int GlowDrawQt::polyline_helper(GlowWind* wind, int painter_type, int size,
} }
if (fill) { if (fill) {
unique_ptr<QPoint[]> qpoints = points_to_qt_points(points, point_cnt);
painter->drawPolygon(qpoints.get(), point_cnt);
} else {
int cnt; int cnt;
unique_ptr<QPoint[]> qpoints = points_to_qt_points_curve(wind, points, point_cnt, &cnt); unique_ptr<QPoint[]> qpoints = points_to_qt_points_curve(wind, points, point_cnt, &cnt);
painter->drawPolygon(qpoints.get(), cnt);
} else {
unique_ptr<QPoint[]> qpoints = points_to_qt_points(points, point_cnt);
painter->setBrush(Qt::NoBrush); painter->setBrush(Qt::NoBrush);
// debug_print("polyline painter_type=%d, fill=%d, point_cnt=%d\n", painter_type, fill, point_cnt); // debug_print("polyline painter_type=%d, fill=%d, point_cnt=%d\n", painter_type, fill, point_cnt);
painter->drawPolyline(qpoints.get(), point_cnt); painter->drawPolyline(qpoints.get(), cnt);
} }
return 1; return 1;
...@@ -1484,7 +1484,7 @@ void GlowDrawQt::copy_buffer( ...@@ -1484,7 +1484,7 @@ void GlowDrawQt::copy_buffer(
void GlowDrawQt::get_window_size(GlowWind* wind, int* width, int* height) void GlowDrawQt::get_window_size(GlowWind* wind, int* width, int* height)
{ {
DrawWindQt* w = (DrawWindQt*)wind->window; DrawWindQt* w = (DrawWindQt*)wind->window;
QSize size = w->window->size(); QSize size = w->buffer->size();
*width = size.width(); *width = size.width();
*height = size.height(); *height = size.height();
} }
...@@ -1792,7 +1792,7 @@ void GlowDrawQt::set_background(GlowWind* wind, glow_eDrawType drawtype, ...@@ -1792,7 +1792,7 @@ void GlowDrawQt::set_background(GlowWind* wind, glow_eDrawType drawtype,
w->background_pixmap_height = pixmap_height; w->background_pixmap_height = pixmap_height;
QPalette pal; QPalette pal;
pal.setBrush(QPalette::Background, pal.setBrush(QPalette::Background,
w->background_pixmap->scaled(w->window->size(), Qt::IgnoreAspectRatio)); w->background_pixmap->scaled(w->buffer->size(), Qt::IgnoreAspectRatio));
w->window->setPalette(pal); w->window->setPalette(pal);
if (w->buffer) { if (w->buffer) {
buffer_background(w, 0); buffer_background(w, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment