summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/PSEditText.H2
-rw-r--r--src/PSEditText.cxx4
-rw-r--r--src/PSEditWidget.cxx10
3 files changed, 13 insertions, 3 deletions
diff --git a/src/PSEditText.H b/src/PSEditText.H
index 7d3d1b8..fee463a 100644
--- a/src/PSEditText.H
+++ b/src/PSEditText.H
@@ -108,6 +108,8 @@ public:
char *get_text();
+ int is_empty();
+
char *get_tag();
int set_tag(const char *t);
diff --git a/src/PSEditText.cxx b/src/PSEditText.cxx
index 0231807..2c572ff 100644
--- a/src/PSEditText.cxx
+++ b/src/PSEditText.cxx
@@ -113,6 +113,10 @@ char *PSEditText::get_text() {
return s;
}
+int PSEditText::is_empty() {
+ return !s || !s[0];
+}
+
char *PSEditText::get_tag() {
return tag;
}
diff --git a/src/PSEditWidget.cxx b/src/PSEditWidget.cxx
index e3c1307..d1bf001 100644
--- a/src/PSEditWidget.cxx
+++ b/src/PSEditWidget.cxx
@@ -116,11 +116,13 @@ void PSEditWidget::new_text(int x1, int y1, const char *s, int p) {
t_old = model->get_cur_text();
model->new_text(ps_x(x1), ps_y(y1), s, cur_size, p, &cur_text_color);
- mod++;
-
+
t = model->get_cur_text();
if (t) {
+ if (!t->is_empty()) {
+ mod++;
+ }
damage(4, bb_x(t), bb_y(t), bb_w(t), bb_h(t));
}
@@ -210,7 +212,9 @@ void PSEditWidget::move(int x1, int y1) {
old_bbh = bb_h(t);
model->move(ps_x(x1), ps_y(y1));
- mod++;
+ if (!t->is_empty() || t->get_tag()) {
+ mod++;
+ }
damage(4, old_bbx, old_bby, old_bbw, old_bbh);
damage(4, bb_x(t), bb_y(t), bb_w(t), bb_h(t));