Skip to content

Commit 2a37f24

Browse files
committed
增加刷屏状态变量,解决 StaticView刷屏是闪屏的问题
1 parent 55fcc1c commit 2a37f24

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

base/party/session.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ namespace mango
9898
mViewZAxis.invalidScreenRectToView();
9999
if (!mViewZAxis.mExistInvalidateView)
100100
continue;
101-
101+
102+
gViewZAxis.isPainting = 1;
102103
mViewZAxis.sendPainMessageToAllInvalidateView();
103-
104+
104105
gSessionLocal.swapScreenFrontBuffer();
106+
gViewZAxis.isPainting = 0;
105107
}
106108
}
107109

base/view/staticView.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ namespace mango
107107
{
108108
if (getCapture () != this)
109109
return 0 ;
110-
111-
cartoonDrag(x - mTouchPrevPosition.x);
110+
111+
if(!gViewZAxis.isPainting)
112+
cartoonDrag(x - mTouchPrevPosition.x);
113+
112114
mTouchPrevPosition.set(x, y);
113115

114116
return 0 ;

base/view/viewZAxis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace mango
2929
{
3030
INIT_LIST_HEAD(&mViewHead);
3131
messageQueue = &gMessageQueue;
32+
isPainting = 0;
3233
}
3334

3435

include/mango/viewZAxis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ namespace mango
6363
bool mExistInvalidateView;
6464
class Session* mSession;
6565
class MessageQueue *messageQueue;
66-
66+
int isPainting;
6767
private:
6868
View* getToppestItem();
6969
View* getBottommestItem();

0 commit comments

Comments
 (0)