diff --git a/submodules/LegacyComponents/Sources/PGPhotoEditor.m b/submodules/LegacyComponents/Sources/PGPhotoEditor.m index b22e95a3db..04345363c3 100644 --- a/submodules/LegacyComponents/Sources/PGPhotoEditor.m +++ b/submodules/LegacyComponents/Sources/PGPhotoEditor.m @@ -177,7 +177,7 @@ _currentInput = movie; CGRect defaultCropRect = CGRectMake(0, 0, _originalSize.width, _originalSize.height); - bool hasCropping = !_CGRectEqualToRectWithEpsilon(self.cropRect, CGRectZero, [self _cropRectEpsilon]) && !_CGRectEqualToRectWithEpsilon(self.cropRect, defaultCropRect, [self _cropRectEpsilon]); + bool hasCropping = !_CGRectEqualToRectWithEpsilon(cropRect, CGRectZero, [self _cropRectEpsilon]) && !_CGRectEqualToRectWithEpsilon(cropRect, defaultCropRect, [self _cropRectEpsilon]); _rotationMode = kGPUImageNoRotation; if (cropOrientation != UIImageOrientationUp || cropMirrored || hasCropping) { diff --git a/submodules/LegacyComponents/Sources/TGMediaPickerGalleryVideoItemView.m b/submodules/LegacyComponents/Sources/TGMediaPickerGalleryVideoItemView.m index 5aa9451df3..25664af48b 100644 --- a/submodules/LegacyComponents/Sources/TGMediaPickerGalleryVideoItemView.m +++ b/submodules/LegacyComponents/Sources/TGMediaPickerGalleryVideoItemView.m @@ -454,6 +454,7 @@ [strongSelf setPlayButtonHidden:true animated:false]; [strongSelf->_entitiesContainerView setupWithPaintingData:adjustments.paintingData]; + [strongSelf->_entitiesContainerView updateVisibility:strongSelf.isPlaying]; [strongSelf->_photoEditor importAdjustments:adjustments]; if (!strongSelf.isPlaying) { @@ -1140,6 +1141,8 @@ [strongSelf->_player play]; } + [strongSelf->_entitiesContainerView updateVisibility:strongSelf.isPlaying]; + strongSelf->_positionTimer = [TGTimerTarget scheduledMainThreadTimerWithTarget:self action:@selector(positionTimerEvent) interval:0.25 repeat:true]; [strongSelf positionTimerEvent]; @@ -1151,10 +1154,14 @@ { if (object == _player && [keyPath isEqualToString:@"rate"]) { - if (_player.rate > FLT_EPSILON) + if (_player.rate > FLT_EPSILON) { [_scrubberView setIsPlaying:true]; - else + [_entitiesContainerView updateVisibility:true]; + } + else { [_scrubberView setIsPlaying:false]; + [_entitiesContainerView updateVisibility:false]; + } } } @@ -1188,6 +1195,8 @@ _positionTimer = [TGTimerTarget scheduledMainThreadTimerWithTarget:self action:@selector(positionTimerEvent) interval:0.25 repeat:true]; [self positionTimerEvent]; } + + [_entitiesContainerView updateVisibility:true]; } - (void)playIfAvailable @@ -1209,6 +1218,8 @@ [_positionTimer invalidate]; _positionTimer = nil; + + [_entitiesContainerView updateVisibility:false]; } - (void)togglePlayback