From b8b2632baa1e7ce495c4d7efe226f4658c5ffc5d Mon Sep 17 00:00:00 2001 From: twanvl Date: Sun, 18 May 2008 20:15:38 +0000 Subject: [PATCH] Fixed: Text sometimes overflows out of text fields, such as comments areas, reminder text areas, and rules text areas: added a clipping region when in native look git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@865 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gui/value/text.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/value/text.cpp b/src/gui/value/text.cpp index 21fb6610..816b26f3 100644 --- a/src/gui/value/text.cpp +++ b/src/gui/value/text.cpp @@ -559,6 +559,10 @@ wxMenu* TextValueEditor::getMenu(int type) const { // ----------------------------------------------------------------------------- : Drawing void TextValueEditor::draw(RotatedDC& dc) { + if (nativeLook()) { + // clip the dc to the region of this control + dc.SetClippingRegion(style().getInternalRect()); + } // update scrollbar prepareDrawScrollbar(dc); // draw text @@ -574,6 +578,9 @@ void TextValueEditor::draw(RotatedDC& dc) { fixSelection(); showCaret(); } + if (nativeLook()) { + dc.DestroyClippingRegion(); + } } void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_selection_end_i, bool old_drop_down_shown) {