Skip to content

Instantly share code, notes, and snippets.

@esetomo
Created August 16, 2013 09:52
Show Gist options
  • Save esetomo/6248623 to your computer and use it in GitHub Desktop.
Save esetomo/6248623 to your computer and use it in GitHub Desktop.
問題の個所の範囲を描画してみる。
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2175,6 +2175,26 @@ void LLTextEditor::drawPreeditMarker()
line_start = next_start;
cur_line++;
}
+
+ // for debug
+ LLCoordGL coord;
+ LLRect bounds;
+ getPreeditLocation(-1, &coord, &bounds, NULL);
+ LLRect preedit_rect_screen;
+ LLUI::glRectToScreen(bounds, &preedit_rect_screen);
+ LLRect preedit_rect_local;
+ screenRectToLocal(preedit_rect_screen, &preedit_rect_local);
+ gl_rect_2d(preedit_rect_local, LLColor4(1.0, 0.0, 0.0, 1.0), 0);
+
+ S32 query_screen_x;
+ S32 query_screen_y;
+ LLUI::glPointToScreen(coord.mX, coord.mY, &query_screen_x, &query_screen_y);
+
+ S32 query_x;
+ S32 query_y;
+ screenPointToLocal(query_screen_x, query_screen_y, &query_x, &query_y);
+
+ gl_rect_2d(query_x - 1, query_y + 1, query_x + 1, query_y - 1, LLColor4(0.0, 1.0, 0.0, 1.0));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment