summaryrefslogtreecommitdiff
path: root/libs/mTextControl/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-18 18:37:37 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-18 18:37:37 +0300
commitec7ad35b1285d445aa9ae1a22fb1b583a62761eb (patch)
treef4b65b21c15a2d778af4aeaf4e8ddd3c9ee34330 /libs/mTextControl/src
parent532a74f2a80a6cb2f65076069b13e0a4beeba689 (diff)
fixes #4132 (NewStory: при открытии настроек плагина не прорисовывается интерфейс)
Diffstat (limited to 'libs/mTextControl/src')
-rw-r--r--libs/mTextControl/src/FormattedTextDraw.cpp7
-rw-r--r--libs/mTextControl/src/FormattedTextDraw.h9
-rw-r--r--libs/mTextControl/src/textcontrol.cpp10
3 files changed, 16 insertions, 10 deletions
diff --git a/libs/mTextControl/src/FormattedTextDraw.cpp b/libs/mTextControl/src/FormattedTextDraw.cpp
index e27739ac0a..49fcf74b8f 100644
--- a/libs/mTextControl/src/FormattedTextDraw.cpp
+++ b/libs/mTextControl/src/FormattedTextDraw.cpp
@@ -298,8 +298,11 @@ BOOL CFormattedTextDraw::TxSetScrollPos(INT, INT, BOOL)
void CFormattedTextDraw::TxInvalidateRect(LPCRECT, BOOL bRedraw)
{
- if (m_hwndParent)
- ::InvalidateRect(m_hwndParent, NULL, bRedraw);
+ if (m_hwndParent) {
+ TextControlData *data = (TextControlData *)GetWindowLongPtr(m_hwndParent, GWLP_USERDATA);
+ if (!data->m_bInsideDraw)
+ ::InvalidateRect(m_hwndParent, NULL, bRedraw);
+ }
}
void CFormattedTextDraw::TxViewChange(BOOL)
diff --git a/libs/mTextControl/src/FormattedTextDraw.h b/libs/mTextControl/src/FormattedTextDraw.h
index 932ec1a63b..dcafdca535 100644
--- a/libs/mTextControl/src/FormattedTextDraw.h
+++ b/libs/mTextControl/src/FormattedTextDraw.h
@@ -128,4 +128,13 @@ struct TextObject
void bbCodeParse(CFormattedTextDraw *ts);
+struct TextControlData
+{
+ HANDLE htu;
+ wchar_t *text;
+ TextObject *mtext;
+ COLORREF clBack = -1;
+ bool m_bInsideDraw = false;
+};
+
#endif //__FORMATTEDTEXTDRAW_H_
diff --git a/libs/mTextControl/src/textcontrol.cpp b/libs/mTextControl/src/textcontrol.cpp
index abc05f65e2..4dcb7652c0 100644
--- a/libs/mTextControl/src/textcontrol.cpp
+++ b/libs/mTextControl/src/textcontrol.cpp
@@ -20,14 +20,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "stdafx.h"
#include "FormattedTextDraw.h"
-struct TextControlData
-{
- HANDLE htu;
- wchar_t *text;
- TextObject *mtext;
- COLORREF clBack = -1;
-};
-
/// Paint ////////////////////////////////////
static LRESULT MTextControl_OnPaint(HWND hwnd)
@@ -37,6 +29,7 @@ static LRESULT MTextControl_OnPaint(HWND hwnd)
// Find the text to draw
TextControlData *data = (TextControlData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ data->m_bInsideDraw = true;
SetTextColor(hdc, RGB(0, 0, 0));
SetBkMode(hdc, TRANSPARENT);
@@ -81,6 +74,7 @@ static LRESULT MTextControl_OnPaint(HWND hwnd)
// Release the device context
EndPaint(hwnd, &ps);
+ data->m_bInsideDraw = false;
return 0;
}