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
d29f44c3
Commit
d29f44c3
authored
Aug 29, 2018
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: Fixed off-by-one error in text drawing function.
parent
f8149f1d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
35 deletions
+25
-35
xtt/exe/rt_xtt/qt/rt_xtt_qt.cqt
xtt/exe/rt_xtt/qt/rt_xtt_qt.cqt
+1
-5
xtt/lib/cow/qt/cow_wow_qt.h
xtt/lib/cow/qt/cow_wow_qt.h
+1
-1
xtt/lib/flow/qt/flow_draw_qt.cqt
xtt/lib/flow/qt/flow_draw_qt.cqt
+9
-22
xtt/lib/glow/qt/glow_draw_qt.cqt
xtt/lib/glow/qt/glow_draw_qt.cqt
+11
-4
xtt/lib/xtt/qt/xtt_methodtoolbar_qt.cqt
xtt/lib/xtt/qt/xtt_methodtoolbar_qt.cqt
+2
-2
xtt/lib/xtt/qt/xtt_methodtoolbar_qt.h
xtt/lib/xtt/qt/xtt_methodtoolbar_qt.h
+1
-1
No files found.
xtt/exe/rt_xtt/qt/rt_xtt_qt.cqt
View file @
d29f44c3
...
@@ -586,10 +586,6 @@ XttQt::XttQt(int argc, char* argv[], int* return_sts)
...
@@ -586,10 +586,6 @@ XttQt::XttQt(int argc, char* argv[], int* return_sts)
char title[120] = "Xtt ";
char title[120] = "Xtt ";
char nodename[80];
char nodename[80];
if (EVEN(*return_sts)) {
return;
}
setlocale(LC_TIME, "en_US");
setlocale(LC_TIME, "en_US");
setlocale(LC_NUMERIC, "POSIX");
setlocale(LC_NUMERIC, "POSIX");
...
@@ -722,7 +718,7 @@ XttQt::XttQt(int argc, char* argv[], int* return_sts)
...
@@ -722,7 +718,7 @@ XttQt::XttQt(int argc, char* argv[], int* return_sts)
cmd_recall = new CoWowRecall();
cmd_recall = new CoWowRecall();
value_recall = new CoWowRecall();
value_recall = new CoWowRecall();
cmd_entry = new CoWowEntryQt(cmd_recall);
cmd_entry = new CoWowEntryQt(cmd_recall);
QObject::connect(cmd_entry, SIGNAL(
editing_finish
ed()), toplevel,
QObject::connect(cmd_entry, SIGNAL(
returnPress
ed()), toplevel,
SLOT(valchanged_cmd_entry()));
SLOT(valchanged_cmd_entry()));
statusbar->addWidget(msg_label);
statusbar->addWidget(msg_label);
...
...
xtt/lib/cow/qt/cow_wow_qt.h
View file @
d29f44c3
...
@@ -253,7 +253,7 @@ class CoWowQtObject : public QObject {
...
@@ -253,7 +253,7 @@ class CoWowQtObject : public QObject {
Q_OBJECT
Q_OBJECT
public:
public:
CoWowQtObject
(
QWidget
*
parent
)
:
QObject
(
parent
),
parent_wid
(
parent
)
CoWowQtObject
(
QWidget
*
parent
)
:
QObject
(),
parent_wid
(
parent
)
{
{
}
}
QWidget
*
parent_wid
;
QWidget
*
parent_wid
;
...
...
xtt/lib/flow/qt/flow_draw_qt.cqt
View file @
d29f44c3
...
@@ -56,8 +56,6 @@
...
@@ -56,8 +56,6 @@
#define DRAW_PRESS_PIX 9
#define DRAW_PRESS_PIX 9
#define roundi(x) ((x) >= 0 ? (int)((x) + 0.5) : (int)((x)-0.5))
typedef struct {
typedef struct {
QWidget* w;
QWidget* w;
int x;
int x;
...
@@ -882,10 +880,10 @@ int FlowDrawQt::rect_helper(FlowCtx* ctx, int painter_type, int size, int x,
...
@@ -882,10 +880,10 @@ int FlowDrawQt::rect_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);
if (fill) {
if (fill) {
// debug_print("fillRect [%d, %d, %d, %d]
\n", x, y, width, height
);
// debug_print("fillRect [%d, %d, %d, %d]
painter_type=%d, with color %s\n", x, y, width, height, painter_type, qPrintable(painter->brush().color().name())
);
painter->fillRect(x, y, width, height, painter->brush());
painter->fillRect(x, y, width, height, painter->brush());
} else {
} else {
// debug_print("drawRect [%d, %d, %d, %d]
\n", x, y, width, height
);
// debug_print("drawRect [%d, %d, %d, %d]
pen %s brush %s\n", x, y, width, height, qPrintable(painter->pen().color().name()), qPrintable(painter->brush().color().name())
);
painter->setBrush(Qt::NoBrush);
painter->setBrush(Qt::NoBrush);
painter->drawRect(x, y, width, height);
painter->drawRect(x, y, width, height);
}
}
...
@@ -1239,21 +1237,13 @@ int FlowDrawQt::text_pango_helper(FlowCtx* ctx, int x, int y, char* text,
...
@@ -1239,21 +1237,13 @@ int FlowDrawQt::text_pango_helper(FlowCtx* ctx, int x, int y, char* text,
int height = rect.height();
int height = rect.height();
if (erase_rect > 0) {
if (erase_rect > 0) {
// debug_print("eraseRect [%d, %d, %d, %d], color=%s\n", x, roundi(y - 0.8 *
// debug_print("eraseRect [%d,%d,%d,%d]\n", x, ROUND(y - 0.8 * height), rect.width() + 1, ROUND(height * (erase_rect / 10.0)));
// height), rect.width(), roundi(height * (erase_rect / 10.0)),
painter->eraseRect(x, ROUND(y - 0.8 * height), rect.width() + 1, ROUND(height * (erase_rect / 10.0)));
// painter->background().color().name().toAscii().data());
painter->eraseRect(x, roundi(y - 0.8 * height), rect.width(),
roundi(height * (erase_rect / 10.0)));
}
}
if (erase_rect < 12) {
if (erase_rect < 12) {
// debug_print("drawText %s at (%d, %d), painter_type=%d, brush=%s, pen=%s,
// debug_print("drawText %s at [%d,%d,%d,%d]\n", text, x, ROUND(y - 0.8 * height), rect.width(), height);
// background=%s\n", text, x, roundi(y - 0.8 * height), painter_type,
painter->drawText(x, ROUND(y - 0.8 * height), rect.width(), height, Qt::TextDontClip, str, &rect);
// painter->brush().color().name().toAscii().data(),
// painter->pen().color().name().toAscii().data(),
// background.name().toAscii().data());
painter->drawText(x, roundi(y - 0.8 * height), rect.width(), height,
Qt::TextDontClip, str);
}
}
delete painter;
delete painter;
...
@@ -1550,8 +1540,7 @@ void FlowDrawQt::clear(FlowCtx* ctx)
...
@@ -1550,8 +1540,7 @@ void FlowDrawQt::clear(FlowCtx* ctx)
QPainter* painter = new QPainter(window_canvas);
QPainter* painter = new QPainter(window_canvas);
painter->setBackground(QBrush(background));
painter->setBackground(QBrush(background));
// debug_print("clear color=%s\n",
// debug_print("clear color=%s\n", painter->background().color().name().toAscii().data());
// painter->background().color().name().toAscii().data());
painter->eraseRect(window_canvas->rect());
painter->eraseRect(window_canvas->rect());
delete painter;
delete painter;
...
@@ -1566,8 +1555,7 @@ void FlowDrawQt::nav_clear(FlowCtx* ctx)
...
@@ -1566,8 +1555,7 @@ void FlowDrawQt::nav_clear(FlowCtx* ctx)
QPainter* painter = new QPainter(nav_window_canvas);
QPainter* painter = new QPainter(nav_window_canvas);
painter->setBackground(QBrush(background));
painter->setBackground(QBrush(background));
// debug_print("nav_clear color=%s\n",
// debug_print("nav_clear color=%s\n\n", painter->background().color().name().toAscii().data());
// painter->background().color().name().toAscii().data());
painter->eraseRect(nav_window_canvas->rect());
painter->eraseRect(nav_window_canvas->rect());
delete painter;
delete painter;
...
@@ -1787,8 +1775,7 @@ void FlowDrawQt::clear_area(
...
@@ -1787,8 +1775,7 @@ void FlowDrawQt::clear_area(
QPainter* painter = new QPainter(window_canvas);
QPainter* painter = new QPainter(window_canvas);
painter->setBackground(QBrush(background));
painter->setBackground(QBrush(background));
// debug_print("clear_area [%d, %d, %d, %d], color=%s\n", ll_x, ll_y, ur_x -
// debug_print("clear_area [%d, %d, %d, %d], color=%s\n", ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, painter->background().color().name().toAscii().data());
// ll_x, ur_y - ll_y, painter->background().color().name().toAscii().data());
painter->eraseRect(ll_x, ll_y, ur_x - ll_x, ur_y - ll_y);
painter->eraseRect(ll_x, ll_y, ur_x - ll_x, ur_y - ll_y);
delete painter;
delete painter;
...
...
xtt/lib/glow/qt/glow_draw_qt.cqt
View file @
d29f44c3
...
@@ -953,9 +953,7 @@ int GlowDrawQt::rect_helper(GlowWind* wind, int painter_type, int size, int x,
...
@@ -953,9 +953,7 @@ int GlowDrawQt::rect_helper(GlowWind* wind, int painter_type, int size, int x,
}
}
if (fill) {
if (fill) {
// debug_print("fillRect [%d, %d, %d, %d] painter_type=%d, with color %s\n",
// debug_print("fillRect [%d, %d, %d, %d] painter_type=%d, with color %s\n", x, y, width, height, painter_type, qPrintable(painter->brush().color().name()));
// x, y, width, height, painter_type,
// qPrintable(painter->brush().color().name()));
painter->fillRect(x, y, width, height, painter->brush());
painter->fillRect(x, y, width, height, painter->brush());
} else {
} else {
// debug_print("drawRect [%d, %d, %d, %d]\n", x, y, width, height);
// debug_print("drawRect [%d, %d, %d, %d]\n", x, y, width, height);
...
@@ -1716,6 +1714,8 @@ void GlowDrawQt::copy_area(GlowWind* wind, int x, int y)
...
@@ -1716,6 +1714,8 @@ void GlowDrawQt::copy_area(GlowWind* wind, int x, int y)
window_height = ctx->navw.window_height;
window_height = ctx->navw.window_height;
}
}
// debug_print("copy_area [%d, %d, %d, %d]\n", x, y, window_width, window_height);
QPainter* painterBuffer
QPainter* painterBuffer
= get_painter(w->buffer, this, glow_eDrawType_Line, 3);
= get_painter(w->buffer, this, glow_eDrawType_Line, 3);
if (x >= 0 && y >= 0) {
if (x >= 0 && y >= 0) {
...
@@ -1767,7 +1767,14 @@ void GlowDrawQt::clear_area(
...
@@ -1767,7 +1767,14 @@ void GlowDrawQt::clear_area(
}
}
DrawWindQt* w = (DrawWindQt*)wind->window;
DrawWindQt* w = (DrawWindQt*)wind->window;
QPainter(w->buffer).eraseRect(ll_x, ll_y, ur_x - ll_x, ur_y - ll_y);
QPainter* painter = new QPainter(w->buffer);
painter->setBackground(QBrush(background));
// debug_print("clear_area [%d, %d, %d, %d], color=%s\n", ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, painter->background().color().name().toAscii().data());
painter->eraseRect(ll_x, ll_y, ur_x - ll_x, ur_y - ll_y);
delete painter;
}
}
void GlowDrawQt::set_inputfocus(GlowWind* wind)
void GlowDrawQt::set_inputfocus(GlowWind* wind)
...
...
xtt/lib/xtt/qt/xtt_methodtoolbar_qt.cqt
View file @
d29f44c3
...
@@ -75,9 +75,9 @@ XttMethodToolbarQt::~XttMethodToolbarQt()
...
@@ -75,9 +75,9 @@ XttMethodToolbarQt::~XttMethodToolbarQt()
delete object;
delete object;
}
}
void XttMethodToolbarQtObject::activate_button(
QAction* action
)
void XttMethodToolbarQtObject::activate_button()
{
{
int idx =
action
->data().toInt();
int idx =
((QAction *) sender())
->data().toInt();
int sts = 0;
int sts = 0;
int is_attr;
int is_attr;
...
...
xtt/lib/xtt/qt/xtt_methodtoolbar_qt.h
View file @
d29f44c3
...
@@ -80,7 +80,7 @@ public:
...
@@ -80,7 +80,7 @@ public:
}
}
public
slots
:
public
slots
:
void
activate_button
(
QAction
*
action
);
void
activate_button
();
void
set_sensitive_cb
();
void
set_sensitive_cb
();
private:
private:
...
...
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