Invert the cropping controls
This commit is contained in:
@@ -1326,55 +1326,32 @@ class VideoEditor:
|
||||
output_name = self._get_next_edited_filename(self.video_path)
|
||||
self.render_video(str(self.video_path.parent / output_name))
|
||||
|
||||
|
||||
|
||||
# Use keyboard shortcuts for crop size adjustment since modifier detection is unreliable
|
||||
# Using bracket keys for crop size adjustment
|
||||
elif key == ord("["): # Contract crop
|
||||
# Cycle through directions: up, right, down, left
|
||||
if not hasattr(self, '_contract_direction'):
|
||||
self._contract_direction = 0
|
||||
directions = ['up', 'right', 'down', 'left']
|
||||
direction = directions[self._contract_direction % 4]
|
||||
self.adjust_crop_size(direction, False, 20)
|
||||
self._contract_direction += 1
|
||||
print(f"Contracted crop {direction}")
|
||||
elif key == ord("]"): # Expand crop
|
||||
# Cycle through directions: up, right, down, left
|
||||
if not hasattr(self, '_expand_direction'):
|
||||
self._expand_direction = 0
|
||||
directions = ['up', 'right', 'down', 'left']
|
||||
direction = directions[self._expand_direction % 4]
|
||||
self.adjust_crop_size(direction, True, 20)
|
||||
self._expand_direction += 1
|
||||
print(f"Expanded crop {direction}")
|
||||
|
||||
# Individual direction controls using shift combinations we can detect
|
||||
elif key == ord("I"): # Shift+i - expand up
|
||||
self.adjust_crop_size('up', True)
|
||||
self.adjust_crop_size('up', False)
|
||||
print(f"Expanded crop upward by {self.crop_size_step}px")
|
||||
elif key == ord("K"): # Shift+k - expand down
|
||||
self.adjust_crop_size('down', True)
|
||||
self.adjust_crop_size('down', False)
|
||||
print(f"Expanded crop downward by {self.crop_size_step}px")
|
||||
elif key == ord("J"): # Shift+j - expand left
|
||||
self.adjust_crop_size('left', True)
|
||||
self.adjust_crop_size('left', False)
|
||||
print(f"Expanded crop leftward by {self.crop_size_step}px")
|
||||
elif key == ord("L"): # Shift+l - expand right
|
||||
self.adjust_crop_size('right', True)
|
||||
self.adjust_crop_size('right', False)
|
||||
print(f"Expanded crop rightward by {self.crop_size_step}px")
|
||||
|
||||
# Contract in specific directions
|
||||
elif key == ord("i"): # i - contract from bottom (reduce height from bottom)
|
||||
self.adjust_crop_size('up', False)
|
||||
self.adjust_crop_size('up', True)
|
||||
print(f"Contracted crop from bottom by {self.crop_size_step}px")
|
||||
elif key == ord("k"): # k - contract from top (reduce height from top)
|
||||
self.adjust_crop_size('down', False)
|
||||
self.adjust_crop_size('down', True)
|
||||
print(f"Contracted crop from top by {self.crop_size_step}px")
|
||||
elif key == ord("j"): # j - contract from right (reduce width from right)
|
||||
self.adjust_crop_size('left', False)
|
||||
self.adjust_crop_size('left', True)
|
||||
print(f"Contracted crop from right by {self.crop_size_step}px")
|
||||
elif key == ord("l"): # l - contract from left (reduce width from left)
|
||||
self.adjust_crop_size('right', False)
|
||||
self.adjust_crop_size('right', True)
|
||||
print(f"Contracted crop from left by {self.crop_size_step}px")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user