mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-02 12:17:46 +08:00
fix clip_children=false
This commit is contained in:
parent
a5268d3155
commit
9766122570
@ -255,6 +255,11 @@ View::View(Context*ctx,const AttributeSet&attrs){
|
||||
viewFlagValues |= LONG_CLICKABLE;
|
||||
viewFlagMasks |= LONG_CLICKABLE;
|
||||
}
|
||||
if(attrs.getBoolean("duplicateParentState",false)){
|
||||
viewFlagValues |= DUPLICATE_PARENT_STATE;
|
||||
viewFlagMasks |= DUPLICATE_PARENT_STATE;
|
||||
}
|
||||
|
||||
const int fadingEdges = attrs.getInt("requiresFadingEdge",std::map<const std::string,int>({
|
||||
{"none",FADING_EDGE_NONE},
|
||||
{"horizontal",FADING_EDGE_HORIZONTAL},
|
||||
@ -2908,7 +2913,7 @@ bool View::draw(Canvas&canvas,ViewGroup*parent,long drawingTime){
|
||||
Rect rcc=Rect::MakeLTRB(cx1,cy1,cx2,cy2);
|
||||
if (!concatMatrix && (parentFlags & (ViewGroup::FLAG_SUPPORT_STATIC_TRANSFORMATIONS |
|
||||
ViewGroup::FLAG_CLIP_CHILDREN)) == ViewGroup::FLAG_CLIP_CHILDREN &&
|
||||
false ==rcc.intersect(mLeft, mTop, mRight-mLeft, mBottom-mTop) &&
|
||||
(false ==rcc.intersect(mLeft, mTop, mRight-mLeft, mBottom-mTop)) &&
|
||||
//canvas.quickReject(mLeft, mTop, mRight, mBottom, Canvas.EdgeType.BW) &&
|
||||
(mPrivateFlags & PFLAG_DRAW_ANIMATION) == 0) {
|
||||
mPrivateFlags2 |= PFLAG2_VIEW_QUICK_REJECTED;
|
||||
@ -3046,6 +3051,7 @@ bool View::draw(Canvas&canvas,ViewGroup*parent,long drawingTime){
|
||||
|
||||
if (!drawingWithRenderNode) {
|
||||
// apply clips directly, since RenderNode won't do it for this draw
|
||||
int clips=0;
|
||||
if ((parentFlags & ViewGroup::FLAG_CLIP_CHILDREN) != 0 && cache == nullptr) {
|
||||
if (offsetForScroll){
|
||||
canvas.rectangle(sx,sy,getWidth(),getHeight());
|
||||
@ -3056,13 +3062,15 @@ bool View::draw(Canvas&canvas,ViewGroup*parent,long drawingTime){
|
||||
canvas.rectangle(0, 0, cache->get_width(), cache->get_height());
|
||||
}
|
||||
}
|
||||
clips++;
|
||||
}
|
||||
|
||||
if (!mClipBounds.empty()) {
|
||||
// clip bounds ignore scroll
|
||||
canvas.rectangle(mClipBounds.left,mClipBounds.top,mClipBounds.width,mClipBounds.height);
|
||||
clips++;
|
||||
}
|
||||
canvas.clip();//cant clip here ,for rotation animator(the view will be cutted)
|
||||
if(clips)canvas.clip();//cant clip here ,for rotation animator(the view will be cutted)
|
||||
}
|
||||
|
||||
if (!drawingWithDrawingCache) {
|
||||
|
@ -1888,7 +1888,7 @@ void ViewGroup::invalidateChild(View*child,Rect&dirty){
|
||||
}
|
||||
|
||||
ViewGroup*ViewGroup::invalidateChildInParent(int* location, Rect& dirty){
|
||||
if (TRUE||(mPrivateFlags & (PFLAG_DRAWN | PFLAG_DRAWING_CACHE_VALID)) != 0) {//0x20 0x8000
|
||||
if ((mPrivateFlags & (PFLAG_DRAWN | PFLAG_DRAWING_CACHE_VALID)) != 0) {//0x20 0x8000
|
||||
// either DRAWN, or DRAWING_CACHE_VALID
|
||||
if ((mGroupFlags & (FLAG_OPTIMIZE_INVALIDATE | FLAG_ANIMATION_DONE)) != FLAG_OPTIMIZE_INVALIDATE) {
|
||||
dirty.offset(location[CHILD_LEFT_INDEX]-mScrollX,location[CHILD_TOP_INDEX]-mScrollY);
|
||||
|
Loading…
Reference in New Issue
Block a user