[gtk+] GtkCssProvider: enable parsing negative GtkBorders



commit d9dab98ad67b98a641c7e94842f821b88b8a83a1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jan 10 20:13:56 2011 +0100

    GtkCssProvider: enable parsing negative GtkBorders
    
    this can be used as in regular CSS under some situations,
    so child items overlap the parent element's border.

 gtk/gtkcssprovider.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index d7e8259..2541050 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -2682,14 +2682,14 @@ border_parse_str (const gchar  *str,
   border = gtk_border_new ();
 
   SKIP_SPACES (str);
-  if (!g_ascii_isdigit (*str))
+  if (!g_ascii_isdigit (*str) && *str != '-')
     return border;
 
   first = unit_parse_str (str, end_str);
   str = *end_str;
   SKIP_SPACES (str);
 
-  if (!g_ascii_isdigit (*str))
+  if (!g_ascii_isdigit (*str) && *str != '-')
     {
       border->left = border->right = border->top = border->bottom = (gint) first;
       *end_str = (gchar *) str;
@@ -2700,7 +2700,7 @@ border_parse_str (const gchar  *str,
   str = *end_str;
   SKIP_SPACES (str);
 
-  if (!g_ascii_isdigit (*str))
+  if (!g_ascii_isdigit (*str) && *str != '-')
     {
       border->top = border->bottom = (gint) first;
       border->left = border->right = (gint) second;
@@ -2712,7 +2712,7 @@ border_parse_str (const gchar  *str,
   str = *end_str;
   SKIP_SPACES (str);
 
-  if (!g_ascii_isdigit (*str))
+  if (!g_ascii_isdigit (*str) && *str != '-')
     {
       border->top = (gint) first;
       border->left = border->right = (gint) second;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]