Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
6335dfe5
Commit
6335dfe5
authored
Oct 26, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: changed GlowDraw to always use double buffering.
parent
d80213b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
28 deletions
+11
-28
xtt/lib/flow/qt/flow_draw_qt.cqt
xtt/lib/flow/qt/flow_draw_qt.cqt
+1
-1
xtt/lib/glow/qt/glow_draw_qt.cqt
xtt/lib/glow/qt/glow_draw_qt.cqt
+10
-27
No files found.
xtt/lib/flow/qt/flow_draw_qt.cqt
View file @
6335dfe5
...
@@ -1071,7 +1071,7 @@ int FlowDrawQt::arc_helper(FlowCtx* ctx, int painter_type, int size, int x,
...
@@ -1071,7 +1071,7 @@ int FlowDrawQt::arc_helper(FlowCtx* ctx, int painter_type, int size, int x,
QPainter* painter = get_painter(painter_type, size, nav);
QPainter* painter = get_painter(painter_type, size, nav);
painter->setBrush(Qt::NoBrush);
painter->setBrush(Qt::NoBrush);
// debug_print("ar
row
[%d, %d, %d, %d], %d, %d\n", x, y, width, height, angle1, angle2);
// debug_print("ar
c
[%d, %d, %d, %d], %d, %d\n", x, y, width, height, angle1, angle2);
painter->drawArc(x, y, width, height, angle1 * 16, angle2 * 16);
painter->drawArc(x, y, width, height, angle1 * 16, angle2 * 16);
delete painter;
delete painter;
...
...
xtt/lib/glow/qt/glow_draw_qt.cqt
View file @
6335dfe5
...
@@ -1469,11 +1469,7 @@ void GlowDrawQt::clear(GlowWind* wind)
...
@@ -1469,11 +1469,7 @@ void GlowDrawQt::clear(GlowWind* wind)
}
}
DrawWindQt* w = (DrawWindQt*)wind->window;
DrawWindQt* w = (DrawWindQt*)wind->window;
if (!w->double_buffer_on) {
QPainter(w->buffer).eraseRect(w->buffer->rect());
} else {
buffer_background(w, 0);
buffer_background(w, 0);
}
}
}
void GlowDrawQt::copy_buffer(
void GlowDrawQt::copy_buffer(
...
@@ -2013,7 +2009,7 @@ void GlowDrawQt::buffer_background(DrawWind* wind, GlowCtx* cctx)
...
@@ -2013,7 +2009,7 @@ void GlowDrawQt::buffer_background(DrawWind* wind, GlowCtx* cctx)
subwindow_y = ctx->navw.subwindow_y;
subwindow_y = ctx->navw.subwindow_y;
}
}
if (!w
->double_buffer_on || !w
indow_width) {
if (!window_width) {
return;
return;
}
}
...
@@ -2064,18 +2060,12 @@ void GlowDrawQt::buffer_background(DrawWind* wind, GlowCtx* cctx)
...
@@ -2064,18 +2060,12 @@ void GlowDrawQt::buffer_background(DrawWind* wind, GlowCtx* cctx)
int GlowDrawQt::export_image(char* filename)
int GlowDrawQt::export_image(char* filename)
{
{
DrawWindQt* w = m_wind;
DrawWindQt* w = m_wind;
QImage image;
QImage* image = w->buffer;
if (image->isNull()) {
if (w->double_buffer_on) {
image = *(w->buffer);
} else {
image = QPixmap::grabWidget(w->window).toImage();
}
if (image.isNull()) {
return 0;
return 0;
}
}
bool sts = image
.
save(filename, "PNG", 0);
bool sts = image
->
save(filename, "PNG", 0);
if (sts) {
if (sts) {
return 0;
return 0;
}
}
...
@@ -2105,15 +2095,8 @@ int GlowDrawQt::print(char* filename, double x0, double x1, int end)
...
@@ -2105,15 +2095,8 @@ int GlowDrawQt::print(char* filename, double x0, double x1, int end)
x = ps_cLeftMargin;
x = ps_cLeftMargin;
y = ps_cPageHeight - ps_cTopMargin;
y = ps_cPageHeight - ps_cTopMargin;
QImage image;
QImage* image = w->buffer;
if (image->isNull()) {
if (w->double_buffer_on) {
image = *(w->buffer);
} else {
image = QPixmap::grabWidget(w->window).toImage();
}
if (image.isNull()) {
return 0;
return 0;
}
}
...
@@ -2125,8 +2108,8 @@ int GlowDrawQt::print(char* filename, double x0, double x1, int end)
...
@@ -2125,8 +2108,8 @@ int GlowDrawQt::print(char* filename, double x0, double x1, int end)
y = ps->y;
y = ps->y;
}
}
width = image
.
width();
width = image
->
width();
height = image
.
height();
height = image
->
height();
if (!feq(x0, 0.0) || !feq(x1, 0.0)) {
if (!feq(x0, 0.0) || !feq(x1, 0.0)) {
double total_width = width / (x1 - x0);
double total_width = width / (x1 - x0);
...
@@ -2188,7 +2171,7 @@ int GlowDrawQt::print(char* filename, double x0, double x1, int end)
...
@@ -2188,7 +2171,7 @@ int GlowDrawQt::print(char* filename, double x0, double x1, int end)
j = 0;
j = 0;
for (k = 0; k < height; k++) {
for (k = 0; k < height; k++) {
for (i = 0; i < width; i++) {
for (i = 0; i < width; i++) {
QColor pixel = QColor(image
.
pixel(i, k));
QColor pixel = QColor(image
->
pixel(i, k));
if (!colorimage) {
if (!colorimage) {
if (!pixel.alpha()) {
if (!pixel.alpha()) {
grey = 255;
grey = 255;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment