From d4d046be09121ab63682692f7c4626f53b94d9d8 Mon Sep 17 00:00:00 2001 From: Sean Barrett Date: Thu, 19 Jun 2014 20:21:08 -0700 Subject: [PATCH] update version number --- README.md | 2 +- stb_textedit.h | 8 +++++--- tests/textedit_sample.c | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ff2bfb7..b8182e7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ library | lastest version | category | description **stb_truetype.h** | 0.8 | graphics | parse, decode, and rasterize characters from truetype fonts **stb_image_write.h** | 0.94 | graphics | image writing to disk: PNG, TGA, BMP **stretchy_buffer.h** | 1.01 | utility | typesafe dynamic array for C (i.e. approximation to vector<>), doesn't compile as C++ -**stb_textedit.h** | 1.2 | UI | guts of a text editor for games etc implementing them from scratch +**stb_textedit.h** | 1.3 | UI | guts of a text editor for games etc implementing them from scratch **stb_dxt.h** | 1.04 | 3D graphics | Fabian "ryg" Giesen's real-time DXT compressor **stb_perlin.h** | 0.2 | 3D graphics | revised Perlin noise (3D input, 1D output) **stb_c_lexer.h** | 0.04 | parsing | simplify writing parsers for C-like languages diff --git a/stb_textedit.h b/stb_textedit.h index a81aed1..90dc8fe 100644 --- a/stb_textedit.h +++ b/stb_textedit.h @@ -1,4 +1,4 @@ -// stb_textedit.h - v1.2 - public domain - Sean Barrett +// stb_textedit.h - v1.3 - public domain - Sean Barrett // Development of this library was sponsored by RAD Game Tools // // This C header file implements the guts of a multi-line text-editing @@ -30,6 +30,7 @@ // // VERSION HISTORY // +// 1.3 (2013-06-19) fix mouse clicking to round to nearest char boundary // 1.2 (2013-05-27) fix some RAD types that had crept into the new code // 1.1 (2013-12-15) move-by-word (requires STB_TEXTEDIT_IS_SPACE ) // 1.0 (2012-07-26) improve documentation, initial public release @@ -40,6 +41,7 @@ // ADDITIONAL CONTRIBUTORS // // Ulf Winklemann: move-by-word in 1.1 +// Scott Graham: mouse selectiom bugfix in 1.3 // // USAGE // @@ -105,8 +107,8 @@ // STB_TEXTEDIT_STRINGLEN(obj) the length of the string (ideally O(1)) // STB_TEXTEDIT_LAYOUTROW(&r,obj,n) returns the results of laying out a line of characters // starting from character #n (see discussion below) -// STB_TEXTEDIT_GETWIDTH(obj,n,i) returns the pixel delta from the xpos of the i-1'th -// character to the i'th char for a line of characters +// STB_TEXTEDIT_GETWIDTH(obj,n,i) returns the pixel delta from the xpos of the i'th character +// to the xpos of the i+1'th char for a line of characters // starting at character #n (i.e. accounts for kerning // with previous char) // STB_TEXTEDIT_KEYTOTEXT(k) maps a keyboard input to an insertable character diff --git a/tests/textedit_sample.c b/tests/textedit_sample.c index d704867..04dc31a 100644 --- a/tests/textedit_sample.c +++ b/tests/textedit_sample.c @@ -48,7 +48,8 @@ int insert_chars(STB_TEXTEDIT_STRING *str, int pos, STB_TEXTEDIT_CHARTYPE *newte // define all the #defines needed -#define KEYDOWN_BIT 0x80000000 +#define KEYDOWN_BIT 0x80000000 + #define STB_TEXTEDIT_STRINGLEN(tc) ((tc)->stringlen) #define STB_TEXTEDIT_LAYOUTROW layout_func #define STB_TEXTEDIT_GETWIDTH(tc,n,i) (1) // quick hack for monospaced