diff options
| author | Ray <[email protected]> | 2019-05-14 00:07:44 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2019-05-14 00:07:44 +0200 |
| commit | 6f7b721d81c46718ae522e4a05e16c93711faefb (patch) | |
| tree | 8644e950fbcd9908c5ce5d220026910b4e22ba51 /src | |
| parent | 6804c2189e07a661ef975146c288619589c90731 (diff) | |
| parent | 00431396b0b516b2296c17e5e5b5fd9e72bacfec (diff) | |
| download | raylib-6f7b721d81c46718ae522e4a05e16c93711faefb.tar.gz raylib-6f7b721d81c46718ae522e4a05e16c93711faefb.zip | |
Merge branch 'master' of https://github.com/raysan5/raylib
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/physac.h | 2 | ||||
| -rw-r--r-- | src/text.c | 10 |
3 files changed, 10 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8ccdc932..b6006c8b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -46,7 +46,7 @@ endif() add_definitions("-DRAYLIB_CMAKE=1") if(USE_AUDIO) - MESSAGE(STATUS "Audio Backend: mini_al") + MESSAGE(STATUS "Audio Backend: miniaudio") set(sources ${raylib_sources}) else() MESSAGE(STATUS "Audio Backend: None (-DUSE_AUDIO=OFF)") diff --git a/src/physac.h b/src/physac.h index 038361a4..374aa4bc 100644 --- a/src/physac.h +++ b/src/physac.h @@ -43,7 +43,7 @@ * NOTE 2: Physac requires static C library linkage to avoid dependency on MinGW DLL (-static -lpthread) * * Use the following code to compile: -* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static -lraylib -lpthread -lopengl32 -lgdi32 -std=c99 +* gcc -o $(NAME_PART).exe $(FILE_NAME) -s -static -lraylib -lpthread -lopengl32 -lgdi32 -lwinmm -std=c99 * * VERY THANKS TO: * Ramon Santamaria (github: @raysan5) @@ -899,7 +899,7 @@ void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, f int state = wordWrap? MEASURE_STATE : DRAW_STATE; int startLine = -1; // Index where to begin drawing (where a line begins) int endLine = -1; // Index where to stop drawing (where a line ends) - + int lastk = -1; // Holds last value of the character position for (int i = 0, k = 0; i < length; i++, k++) { int glyphWidth = 0; @@ -954,6 +954,11 @@ void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, f textOffsetX = 0; i = startLine; glyphWidth = 0; + + // Save character position when we switch states + int tmp = lastk; + lastk = k - 1; + k = tmp; } } @@ -981,7 +986,7 @@ void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, f bool isGlyphSelected = false; if ((selectStart >= 0) && (k >= selectStart) && (k < (selectStart + selectLength))) { - Rectangle strec = {rec.x + textOffsetX-1, rec.y + textOffsetY, glyphWidth, (font.baseSize + font.baseSize/4)*scaleFactor }; + Rectangle strec = {rec.x + textOffsetX-1, rec.y + textOffsetY, glyphWidth, font.baseSize*scaleFactor }; DrawRectangleRec(strec, selectBack); isGlyphSelected = true; } @@ -1005,6 +1010,7 @@ void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, f startLine = endLine; endLine = -1; glyphWidth = 0; + k = lastk; state = !state; } } |
