summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRr422018-06-18 14:36:44 +0530
committerRr422018-06-18 14:36:44 +0530
commit5212a10cc69b42b32b0dfb4c48e6c9d3b596dec6 (patch)
tree2aa03bc5fff1b09bf0156634a4298f6621d2e252
parenta4052ae05814bdda4ec91e2e8d07e470428f06b1 (diff)
downloadLDMicroGtk-5212a10cc69b42b32b0dfb4c48e6c9d3b596dec6.tar.gz
LDMicroGtk-5212a10cc69b42b32b0dfb4c48e6c9d3b596dec6.tar.bz2
LDMicroGtk-5212a10cc69b42b32b0dfb4c48e6c9d3b596dec6.zip
fixed bug in TextOut function
-rw-r--r--ldmicro/draw_outputdev.cpp2
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/ldmicro/draw_outputdev.cpp b/ldmicro/draw_outputdev.cpp
index 9ac55ab..9965483 100644
--- a/ldmicro/draw_outputdev.cpp
+++ b/ldmicro/draw_outputdev.cpp
@@ -278,7 +278,7 @@ void PaintWindow()
}
cy -= 2;
DrawEndRung(0, cy);
- g_print("cy = %i\n", cy);
+
if(SelectedGxAfterNextPaint >= 0) {
MoveCursorNear(SelectedGxAfterNextPaint, SelectedGyAfterNextPaint);
InvalidateRect(DrawWindow, NULL, FALSE);
diff --git a/ldmicro/lib/linuxUI/linuxUI.cpp b/ldmicro/lib/linuxUI/linuxUI.cpp
index d8bb06c..5125ed9 100644
--- a/ldmicro/lib/linuxUI/linuxUI.cpp
+++ b/ldmicro/lib/linuxUI/linuxUI.cpp
@@ -309,9 +309,12 @@ void TextOut(HWID hWid, HCRDC hcr, int nXStart, int nYStart, LPCTSTR lpString, i
if (resize_flag)
gtk_widget_set_size_request(hWid, width, height);
+ char* text = (char*)malloc(cchString);
+ strncpy(text, lpString, cchString);
+ text[cchString] = '\0';
cairo_move_to(hcr, nXStart, nYStart);
- cairo_show_text(hcr, lpString);
+ cairo_show_text(hcr, text);
cairo_fill (hcr);
}