[Xfce4-commits] <xfce4-panel:nick/gtk3> Clock: Fixed drawing coordinates

Andrzej noreply at xfce.org
Mon Apr 15 02:20:02 CEST 2013


Updating branch refs/heads/nick/gtk3
         to df4ab2db9bca20eb71841cffa8d813847ca2dd57 (commit)
       from e4e4a6a7783f4a3f5b6e13b88e3edc1e12b21936 (commit)

commit df4ab2db9bca20eb71841cffa8d813847ca2dd57
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Mon Apr 15 00:18:34 2013 +0100

    Clock: Fixed drawing coordinates

 plugins/clock/clock-analog.c |    4 ----
 plugins/clock/clock-binary.c |    4 ++--
 plugins/clock/clock-lcd.c    |    4 ++--
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/plugins/clock/clock-analog.c b/plugins/clock/clock-analog.c
index 8ed2304..ff08aa6 100644
--- a/plugins/clock/clock-analog.c
+++ b/plugins/clock/clock-analog.c
@@ -229,10 +229,6 @@ xfce_clock_analog_draw (GtkWidget *widget,
   yc = (allocation.height / 2.0);
   radius = MIN (xc, yc);
 
-  /* add the window offset */
-  xc += allocation.x;
-  yc += allocation.y;
-
   /* get the local time */
   time = clock_time_get_time (analog->time);
 
diff --git a/plugins/clock/clock-binary.c b/plugins/clock/clock-binary.c
index f56a050..0b7775e 100644
--- a/plugins/clock/clock-binary.c
+++ b/plugins/clock/clock-binary.c
@@ -497,8 +497,8 @@ xfce_clock_binary_draw (GtkWidget *widget,
   gtk_widget_get_allocation (widget, &alloc);
   alloc.width -= 1 + 2 * pad_x;
   alloc.height -= 1 + 2 * pad_y;
-  alloc.x += pad_x + 1;
-  alloc.y += pad_y + 1;
+  alloc.x = pad_x + 1;
+  alloc.y = pad_y + 1;
 
   /* align columns and fix rounding */
   cols = binary->true_binary ? 6 : (binary->show_seconds ? 6 : 4);
diff --git a/plugins/clock/clock-lcd.c b/plugins/clock/clock-lcd.c
index 92c0189..662bab1 100644
--- a/plugins/clock/clock-lcd.c
+++ b/plugins/clock/clock-lcd.c
@@ -302,8 +302,8 @@ xfce_clock_lcd_draw (GtkWidget *widget,
   offset_y = rint ((allocation.height - size) / 2.00);
 
   /* only allow positive values from the base point */
-  offset_x = allocation.x + MAX (0.00, offset_x);
-  offset_y = allocation.y + MAX (0.00, offset_y);
+  offset_x = MAX (0.00, offset_x);
+  offset_y = MAX (0.00, offset_y);
 
   cairo_push_group (cr);
 


More information about the Xfce4-commits mailing list