修复序列帧播放淡入闪烁
序列帧图片不再复用普通图片加载淡入样式 补充画布序列帧无过渡播放回归测试 记录序列帧播放闪烁排障经验
This commit is contained in:
@@ -1087,6 +1087,14 @@ describe('ImageCanvasWorldView', () => {
|
||||
expect(frame.getAttribute('src')).toBe(
|
||||
'https://oss.example.com/frame01.png?signature=1',
|
||||
);
|
||||
expect(frame.className).toBe(
|
||||
'image-canvas-editor__layer-image-sequence-frame',
|
||||
);
|
||||
expect(frame.style.opacity).toBe('0');
|
||||
expect(frame.style.transition).toBe('none');
|
||||
fireEvent.load(frame);
|
||||
expect(frame.style.opacity).toBe('1');
|
||||
expect(frame.style.transition).toBe('none');
|
||||
expect(within(layerButton).getByText('1/2')).toBeTruthy();
|
||||
expect(within(layerButton).getByText('动作')).toBeTruthy();
|
||||
|
||||
|
||||
@@ -755,16 +755,14 @@ function ImageCanvasImageSequenceFrame({
|
||||
alt={isVisible ? `画布序列帧:${layer.title}` : ''}
|
||||
aria-hidden={isVisible ? undefined : true}
|
||||
decoding="async"
|
||||
className={`image-canvas-editor__layer-image-sequence-frame ${
|
||||
isVisible && isLoaded
|
||||
? 'image-canvas-editor__layer-image--loaded'
|
||||
: 'image-canvas-editor__layer-image--loading'
|
||||
}`}
|
||||
className="image-canvas-editor__layer-image-sequence-frame"
|
||||
style={{
|
||||
inset: 0,
|
||||
opacity: isVisible && isLoaded ? 1 : 0,
|
||||
position: 'absolute',
|
||||
transition: 'none',
|
||||
transform: mediaTransform,
|
||||
zIndex: 1,
|
||||
}}
|
||||
onLoad={() => onFrameReady(frameKey)}
|
||||
onError={() => onFrameReady(frameKey)}
|
||||
|
||||
Reference in New Issue
Block a user