Hi.

I've posted a patch some weeks ago. I'm surprised to had no reactions. So, i 
would like to take a second chance.

I sometimes draw coloured squares (eg blue) with bright text inside (eg white).

When i select this text, i can't see it because the highlight is yellow.

So i would like to suggest this patch and have your opinion.

This patch still have a problem : it doesn't change the cursor color... but 
it's more a patch for opening the discussion than a definitive solution.

Regards.

Paul.
>From ad6704a42ecc166fc8612cee970c149fdc052be7 Mon Sep 17 00:00:00 2001
From: Paul Chavent <paul.chav...@fnac.net>
Date: Fri, 30 Mar 2012 23:58:06 +0200
Subject: [PATCH] Highlight color exception for bright text.

---
 lib/diagdkrenderer.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/diagdkrenderer.c b/lib/diagdkrenderer.c
index 015fb9a..e3413a2 100644
--- a/lib/diagdkrenderer.c
+++ b/lib/diagdkrenderer.c
@@ -690,6 +690,15 @@ draw_text_line (DiaRenderer *object, TextLine *text_line,
   real font_height = text_line_get_height(text_line);
   real scale = dia_transform_length(renderer->transform, 1.0);
 
+  if(renderer->highlight_color)
+    {
+      if(0.72 < (color->red * 0.299 + color->green * 0.587 + color->blue * 
0.114))
+        {
+          static Color highlight_color = {0};
+          renderer->highlight_color = &highlight_color;
+        }
+    }
+
   if (text == NULL || *text == '\0') return; /* Don't render empty strings. */
 
   point_copy(&start_pos,pos);
-- 
1.7.4.4

_______________________________________________
dia-list mailing list
dia-list@gnome.org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia

Reply via email to