[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Text selections flicker unnecessarily
From: |
Alexander Malmberg |
Subject: |
Text selections flicker unnecessarily |
Date: |
Sun, 12 May 2002 15:19:23 +0200 |
Hi,
When highlighting text GSSimpleLayoutManager calls NSHighlightRect() for
each line of selected text. Since each NSHighlightRect() call flushes
the graphics this is quite slow and flickers a lot. I've attached a
patch that changes GSSimpleLayoutManager to use PScompositerect instead.
I'm not sure that NSHighlightRect() should really flush, but other
callers seem to depend on it.
- Alexander Malmberg
Index: gui/Source/GSSimpleLayoutManager.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/gui/Source/GSSimpleLayoutManager.m,v
retrieving revision 1.29
diff -u -r1.29 GSSimpleLayoutManager.m
--- gui/Source/GSSimpleLayoutManager.m 25 Mar 2002 02:27:35 -0000 1.29
+++ gui/Source/GSSimpleLayoutManager.m 12 May 2002 12:21:17 -0000
@@ -47,6 +47,7 @@
#include <AppKit/NSTextStorage.h>
#include <AppKit/NSTextContainer.h>
#include <AppKit/NSStringDrawing.h>
+#include <AppKit/PSOperators.h>
#include "GSSimpleLayoutManager.h"
@@ -706,7 +707,9 @@
for (i = 0; i < count; i++)
{
- NSHighlightRect (rects[i]);
+ PScompositerect(NSMinX(rects[i]), NSMinY(rects[i]),
+ NSWidth(rects[i]), NSHeight(rects[i]),
+ NSCompositeHighlight);
}
}
- Text selections flicker unnecessarily,
Alexander Malmberg <=