HXPhotoPicker icon indicating copy to clipboard operation
HXPhotoPicker copied to clipboard

照片合成使用的drawViewHierarchyInRect:afterScreenUpdates会延迟动画

Open boboxiaodd opened this issue 1 year ago • 1 comments

bug提交前阅读 1.请先阅读【相关问题】,里面有常见问题的解决方案; 2.请先搜索已有的Issues,尝试找到相同问题的讨论; 3.请先阅读相关类的API、源码,尝试从源码找到答案; 4.如果以上步骤都未能解决你的疑问,欢迎提交ISSUE;

bug描述 每次选择照片后带有图片合成的编辑,APP内的webkit动画都会延迟掉帧

版本号 1.HXPhotoPicker版本号:最新 2.手机系统版本号:15.4.1 3.手机型号:iPhone11

复现步骤

  1. 遇到问题的相关效果、类是:? 2.具体的操作步骤是:?

截图、GIF 提供bug出现时的截图或者GIF。

问题出在 https://github.com/SilenceLove/HXPhotoPicker/blob/fb0af5b41db7dcd757013cd7d7414949b08039c5/HXPhotoPicker/Category/UIView%2BHXExtension.m#L310

相关报道: https://stackoverflow.com/questions/23157653/drawviewhierarchyinrectafterscreenupdates-delays-other-animations

解决办法: 将 afterScreenUpdates:NO

boboxiaodd avatar Jul 26 '22 03:07 boboxiaodd

只改这个参数不够,还需在完成按钮点击前,隐藏当前选中的图层边框,并延时0.5秒

        _toolsView.didDoneBtnBlock = ^{
            HXPhotoEditStickerView * item = weakSelf.editingView.clippingView.imageView.stickerView;
            if(item.selectItemView){
                [item removeSelectItem];
            }
            weakSelf.view.userInteractionEnabled = NO;
            [weakSelf.view hx_showLoadingHUDText:nil];
            [NSTimer scheduledTimerWithTimeInterval:0.5 repeats:NO block:^(NSTimer * _Nonnull timer) {
                [weakSelf startEditImage];
            }];
        };

boboxiaodd avatar Jul 26 '22 10:07 boboxiaodd