mirror of
https://github.com/zakk4223/CocoaSplit.git
synced 2026-05-15 14:15:50 -06:00
If the size of a source changes, the attached input will resize to match
This commit is contained in:
parent
450b0e3056
commit
74dadf7428
3 changed files with 17 additions and 1 deletions
|
|
@ -252,6 +252,7 @@ typedef enum resize_style_t {
|
|||
NSDictionary *_undoActionMap;
|
||||
float _croppedAR;
|
||||
NSMutableArray *_frameUpdateQueue;
|
||||
NSSize _previousSize;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -745,6 +745,7 @@ static NSArray *_sourceTypes = nil;
|
|||
_needsAdjustPosition = NO;
|
||||
_topLevelHeight = 0;
|
||||
_topLevelWidth = 0;
|
||||
_previousSize = NSZeroSize;
|
||||
_frameUpdateQueue = [NSMutableArray array];
|
||||
self.changeInterval = 20.0f;
|
||||
|
||||
|
|
@ -2094,6 +2095,21 @@ static NSArray *_sourceTypes = nil;
|
|||
[self.videoInput frameTickFromInput:self];
|
||||
|
||||
[self.layer frameTick];
|
||||
NSSize capSize = self.videoInput.captureSize;
|
||||
|
||||
if (!NSEqualSizes(capSize, _previousSize) )
|
||||
{
|
||||
if (!NSEqualSizes(NSZeroSize, _previousSize))
|
||||
{
|
||||
resize_style resizeSave = self.resizeType;
|
||||
self.resizeType = kResizeCenter | kResizeFree;
|
||||
[self updateSize:capSize.width height:capSize.height];
|
||||
self.resizeType = resizeSave;
|
||||
}
|
||||
_previousSize = capSize;
|
||||
}
|
||||
|
||||
|
||||
if (self.needsAdjustment)
|
||||
{
|
||||
[self adjustInputSize:self.needsAdjustPosition];
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@
|
|||
_fps_start_time = CFAbsoluteTimeGetCurrent();
|
||||
_fps_frame_cnt = 0;
|
||||
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateStatistics:) name:CSNotificationStatisticsUpdate object:nil];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue