diff options
author | Neil <nyamatongwe@gmail.com> | 2025-05-29 10:37:25 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2025-05-29 10:37:25 +1000 |
commit | 922a70ac051ac097632bc26e56c23fffb65aa43d (patch) | |
tree | a5535b583aec8190f40643dd3b2c2770ff641095 | |
parent | d2926229e07bffa106216e23bfcf0f28eee55f1a (diff) | |
download | scintilla-mirror-922a70ac051ac097632bc26e56c23fffb65aa43d.tar.gz |
Recreate all pixmaps if any null as this may better handle cases where some
allocations succeed and others fail.
-rw-r--r-- | src/EditView.cxx | 2 | ||||
-rw-r--r-- | src/Editor.cxx | 12 | ||||
-rw-r--r-- | src/MarginView.cxx | 2 |
3 files changed, 6 insertions, 10 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx index e8c8562ec..dddd84d94 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -277,7 +277,7 @@ void EditView::DropGraphics() noexcept { } void EditView::RefreshPixMaps(Surface *surfaceWindow, const ViewStyle &vsDraw) { - if (!pixmapIndentGuide) { + if (!(pixmapIndentGuide && pixmapIndentGuideHighlight)) { // 1 extra pixel in height so can handle odd/even positions and so produce a continuous line pixmapIndentGuide = surfaceWindow->AllocatePixMap(1, vsDraw.lineHeight + 1); pixmapIndentGuideHighlight = surfaceWindow->AllocatePixMap(1, vsDraw.lineHeight + 1); diff --git a/src/Editor.cxx b/src/Editor.cxx index d081c989e..4c35093db 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1846,15 +1846,11 @@ void Editor::PaintSelMargin(Surface *surfaceWindow, const PRectangle &rc) { void Editor::RefreshPixMaps(Surface *surfaceWindow) { view.RefreshPixMaps(surfaceWindow, vs); marginView.RefreshPixMaps(surfaceWindow, vs); - if (view.bufferedDraw) { + if (view.bufferedDraw && !(view.pixmapLine && marginView.pixmapSelMargin)) { const PRectangle rcClient = GetClientRectangle(); - if (!view.pixmapLine) { - view.pixmapLine = surfaceWindow->AllocatePixMap(static_cast<int>(rcClient.Width()), vs.lineHeight); - } - if (!marginView.pixmapSelMargin) { - marginView.pixmapSelMargin = surfaceWindow->AllocatePixMap(vs.fixedColumnWidth, - static_cast<int>(rcClient.Height())); - } + view.pixmapLine = surfaceWindow->AllocatePixMap(static_cast<int>(rcClient.Width()), vs.lineHeight); + marginView.pixmapSelMargin = surfaceWindow->AllocatePixMap(vs.fixedColumnWidth, + static_cast<int>(rcClient.Height())); } } diff --git a/src/MarginView.cxx b/src/MarginView.cxx index 09b01959e..18c1b33b0 100644 --- a/src/MarginView.cxx +++ b/src/MarginView.cxx @@ -124,7 +124,7 @@ void MarginView::DropGraphics() noexcept { } void MarginView::RefreshPixMaps(Surface *surfaceWindow, const ViewStyle &vsDraw) { - if (!pixmapSelPattern) { + if (!(pixmapSelPattern && pixmapSelPatternOffset1)) { constexpr int patternSize = 8; pixmapSelPattern = surfaceWindow->AllocatePixMap(patternSize, patternSize); pixmapSelPatternOffset1 = surfaceWindow->AllocatePixMap(patternSize, patternSize); |