summaryrefslogtreecommitdiffstats
path: root/win/tkWinFont.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-04-19 10:01:26 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-04-19 10:01:26 (GMT)
commit981e941cbfec9cdea31b3bde6666e9a5afc6ea85 (patch)
tree5e9c99bf8f09a6d3b61c3b272d77272902a810af /win/tkWinFont.c
parenta485a445252972c78b1296013f221f7f838c438b (diff)
downloadtk-981e941cbfec9cdea31b3bde6666e9a5afc6ea85.zip
tk-981e941cbfec9cdea31b3bde6666e9a5afc6ea85.tar.gz
tk-981e941cbfec9cdea31b3bde6666e9a5afc6ea85.tar.bz2
Apply another patch by Christopher Chavez that fixes the jerk of strings on aqua when selecting text (see the ticket). There is no functional change on Windows and Linux in this patch.
Diffstat (limited to 'win/tkWinFont.c')
-rw-r--r--win/tkWinFont.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index cef505a..39abda4 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -1402,6 +1402,37 @@ TkpDrawCharsInContext(
rangeLength, x+widthUntilStart, y);
}
+/* UNTESTED */
+void
+TkpDrawAngledCharsInContext(
+ Display *display, /* Display on which to draw. */
+ Drawable drawable, /* Window or pixmap in which to draw. */
+ GC gc, /* Graphics context for drawing characters. */
+ Tk_Font tkfont, /* Font in which characters will be drawn; must
+ * be the same as font used in GC. */
+ const char * source, /* UTF-8 string to be displayed. Need not be
+ * '\0' terminated. All Tk meta-characters
+ * (tabs, control characters, and newlines)
+ * should be stripped out of the string that is
+ * passed to this function. If they are not
+ * stripped out, they will be displayed as
+ * regular printing characters. */
+ int numBytes, /* Number of bytes in string. */
+ int rangeStart, /* Index of first byte to draw. */
+ int rangeLength, /* Length of range to draw in bytes. */
+ double x, double y, /* Coordinates at which to place origin of the
+ * whole (not just the range) string when
+ * drawing. */
+ double angle) /* What angle to put text at, in degrees. */
+{
+ int widthUntilStart;
+ (void) numBytes; /*unused*/
+
+ Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
+ TkDrawAngledChars(display, drawable, gc, tkfont, source + rangeStart,
+ rangeLength, x+widthUntilStart, y, angle);
+}
+
/*
*-------------------------------------------------------------------------
*