summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2013-06-09 23:01:31 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2013-06-09 23:01:31 (GMT)
commitaed45245289e3e16d421aa6154dcb803e86addaa (patch)
tree4c55410d7b46cb108c7ef9c69cac88644ef97f48
parented59530ca0cc8e4cf03ea8328122bb3d279840a9 (diff)
Fixed a bug when drawing carets at high addresses.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@352 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
-rw-r--r--ChangeLog12
-rw-r--r--src/glibext/gbuffersegment.c8
-rw-r--r--src/glibext/gcodebuffer.c1
-rw-r--r--src/gtkext/gtkbufferview.c5
4 files changed, 20 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index e8d9c4d..18ee7cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+13-06-10 Cyrille Bagard <nocbos@gmail.com>
+
+ * src/glibext/gbuffersegment.c:
+ Change the color of selections.
+
+ * src/glibext/gcodebuffer.c:
+ Define a clip for Cairo.
+
+ * src/gtkext/gtkbufferview.c:
+ Fix a bug when drawing carets at high addresses. Disable the deprecated
+ GDK clip.
+
13-06-09 Cyrille Bagard <nocbos@gmail.com>
* pixmaps/Makefile.am:
diff --git a/src/glibext/gbuffersegment.c b/src/glibext/gbuffersegment.c
index 031075c..31f1840 100644
--- a/src/glibext/gbuffersegment.c
+++ b/src/glibext/gbuffersegment.c
@@ -593,9 +593,9 @@ void g_buffer_segment_set_style(GBufferSegment *segment, SegRenderingStyle style
case SRS_HIGHLIGHT_SAME:
- segment->cache_bg.red = 0;
- segment->cache_bg.green = 0;
- segment->cache_bg.blue = 65535;
+ segment->cache_bg.red = 32768;
+ segment->cache_bg.green = 32768;
+ segment->cache_bg.blue = 32768;
segment->cache_alt_fg.red = 65535 - segment->cache_fg.red;
segment->cache_alt_fg.green = 65535 - segment->cache_fg.green;
@@ -643,7 +643,9 @@ void g_buffer_segment_draw(GBufferSegment *segment, cairo_t *cairo, GFontCache *
segment->cache_bg.blue / 65535.0);
cairo_rectangle(cairo, *x, y, segment->logical.width, segment->logical.height);
+ cairo_set_operator(cairo, CAIRO_OPERATOR_DIFFERENCE);
cairo_fill(cairo);
+ cairo_set_operator(cairo, CAIRO_OPERATOR_OVER);
}
diff --git a/src/glibext/gcodebuffer.c b/src/glibext/gcodebuffer.c
index 914a3d5..70064e3 100644
--- a/src/glibext/gcodebuffer.c
+++ b/src/glibext/gcodebuffer.c
@@ -1381,6 +1381,7 @@ void g_buffer_view_draw(const GBufferView *view, const GdkEventExpose *event, Gd
cairo = gdk_cairo_create(event->window);
gdk_cairo_region(cairo, event->region);
+ cairo_clip(cairo);
real_x = fake_x + view->left_text;
real_y = fake_y + event->area.y;
diff --git a/src/gtkext/gtkbufferview.c b/src/gtkext/gtkbufferview.c
index 6556eb8..7cb1e9b 100644
--- a/src/gtkext/gtkbufferview.c
+++ b/src/gtkext/gtkbufferview.c
@@ -231,8 +231,7 @@ static gboolean gtk_buffer_view_button_press(GtkWidget *widget, GdkEventButton *
if (addr != VMPA_INVALID)
{
- //gtk_buffer_view_compute_fake_coord(view, &view->caret.x, &view->caret.y);
-
+ gtk_buffer_view_compute_relative_coords(view, &view->caret.x, &view->caret.y);
printf(" mouse --old-- :: (%d ; %d)\n",
view->caret.x, view->caret.y);
@@ -436,7 +435,7 @@ static gboolean gtk_buffer_view_expose(GtkWidget *widget, GdkEventExpose *event)
gdk_window_begin_paint_region(drawable, event->region);
- gdk_gc_set_clip_region(pview->gc, event->region);
+ //gdk_gc_set_clip_region(pview->gc, event->region);
style = gtk_widget_get_style(GTK_WIDGET(view));