From 975fe3c017e8a491d041e5dfe97955e7544dcd6c Mon Sep 17 00:00:00 2001 From: dipsywong98 Date: Fri, 1 Mar 2019 00:37:53 +0800 Subject: [PATCH] overlay now compatible with swap content --- ImpressionistDoc.cpp | 1 + PaintView.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ImpressionistDoc.cpp b/ImpressionistDoc.cpp index c4ece37..f159b6c 100644 --- a/ImpressionistDoc.cpp +++ b/ImpressionistDoc.cpp @@ -140,6 +140,7 @@ void ImpressionistDoc::swapContent() m_ucPainting = m_ucBitmap; m_ucBitmap = temp; m_ucOriginal = temp; + memcpy(m_ucBackup, m_ucPainting, m_nWidth*m_nHeight * 3); m_pUI->m_origView->refresh(); m_pUI->m_paintView->refresh(); } diff --git a/PaintView.cpp b/PaintView.cpp index 55ef163..19faf60 100644 --- a/PaintView.cpp +++ b/PaintView.cpp @@ -224,6 +224,12 @@ void PaintView::draw() VideoProcessor::continueWriteStream(); + glFlush(); + if(m_pDoc->m_ucPainting && m_pDoc->m_ucBackup) + { + + memcpy(m_pDoc->m_ucPainting, m_pDoc->m_ucBackup, drawWidth*drawHeight * 3); + } } void PaintView::prepareAutoFill()