From 668b974dd714b5ba550ef7726c79733c7079dede Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@unixuser.org>
Date: Fri, 14 Oct 2011 10:04:16 +0900
Subject: [PATCH] Improve border rendering without theme.

---
 eek/eek-gtk-keyboard.c | 4 ++--
 eek/eek-renderer.c     | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/eek/eek-gtk-keyboard.c b/eek/eek-gtk-keyboard.c
index 991b8868..f808997f 100644
--- a/eek/eek-gtk-keyboard.c
+++ b/eek/eek-gtk-keyboard.c
@@ -141,11 +141,11 @@ eek_gtk_keyboard_real_draw (GtkWidget *self,
         style = gtk_widget_get_style (self);
         state = gtk_widget_get_state (self);
 
-        color = color_from_gdk_color (&style->fg[state]);
+        color = color_from_gdk_color (&style->text[state]);
         eek_renderer_set_default_foreground_color (priv->renderer, color);
         eek_color_free (color);
 
-        color = color_from_gdk_color (&style->bg[state]);
+        color = color_from_gdk_color (&style->base[state]);
         eek_renderer_set_default_background_color (priv->renderer, color);
         eek_color_free (color);
     }
diff --git a/eek/eek-renderer.c b/eek/eek-renderer.c
index 053010a6..af1c8da9 100644
--- a/eek/eek-renderer.c
+++ b/eek/eek-renderer.c
@@ -249,8 +249,8 @@ render_key_outline (EekRenderer *renderer,
     /* need to rescale so that the border fit inside the clipping
        region */
     eek_element_get_bounds (EEK_ELEMENT(key), &bounds);
-    scale = MIN((bounds.width - border_width) / bounds.width,
-                (bounds.height - border_width) / bounds.height);
+    scale = MIN((bounds.width - border_width * 2) / bounds.width,
+                (bounds.height - border_width * 2) / bounds.height);
 
     outline = eek_keyboard_get_outline (priv->keyboard, oref);
     outline = eek_outline_copy (outline);
@@ -260,8 +260,8 @@ render_key_outline (EekRenderer *renderer,
     }
 
     cairo_translate (cr,
-                     border_width / 2 * priv->scale,
-                     border_width / 2 * priv->scale);
+                     border_width * priv->scale * scale,
+                     border_width * priv->scale * scale);
 
     if (gradient_type != EEK_GRADIENT_NONE) {
         cairo_pattern_t *pat;
-- 
GitLab