From 035866f45bae0c8193b0f9e30a0898e5fd33ca10 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Sat, 29 Sep 2018 08:00:50 +1000 Subject: Bug [#2047]. Avoid processing when SCI_SETZOOM to same value as before. --- src/Editor.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index 3093e6c57..ab8f1dba3 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -7556,11 +7556,15 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { InvalidateStyleRedraw(); break; - case SCI_SETZOOM: - vs.zoomLevel = static_cast(wParam); - InvalidateStyleRedraw(); - NotifyZoom(); - break; + case SCI_SETZOOM: { + const int zoomLevel = static_cast(wParam); + if (zoomLevel != vs.zoomLevel) { + vs.zoomLevel = zoomLevel; + InvalidateStyleRedraw(); + NotifyZoom(); + } + break; + } case SCI_GETZOOM: return vs.zoomLevel; -- cgit v1.2.3