Skip to content

Commit

Permalink
add todo related to crop fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mael Le Goff committed Mar 11, 2022
1 parent 3890088 commit 63746c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/domain/bloc/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ class VideoEditorController extends ChangeNotifier {
_preferredCropAspectRatio = value;
notifyListeners();
} else if (value >= 0) {
// TODO : when switching from a preferred aspect ratio to another it keep reducing the crop size

final length = cropStyle.boundariesLength * 4;
final videoWidth = videoDimension.width;
final videoHeight = videoDimension.height;
Expand Down Expand Up @@ -434,8 +436,9 @@ class VideoEditorController extends ChangeNotifier {
//----------------//
final List<String> filters = [crop, scaleInstruction, rotation, gif];
filters.removeWhere((item) => item.isEmpty);
final String filter =
filters.isNotEmpty && isFiltersEnabled ? "-filter:v " + filters.join(",") : "";
final String filter = filters.isNotEmpty && isFiltersEnabled
? "-filter:v " + filters.join(",")
: "";
final String execute =
" -i \'$videoPath\' ${customInstruction ?? ""} $filter ${_getPreset(preset)} $trim -y $outputPath";

Expand Down
1 change: 1 addition & 0 deletions lib/ui/crop/crop_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ class _CropGridViewerState extends State<CropGridViewer> {
final double right = left + width;
final double bottom = top + height;

// TODO : sometimes cannot move the crop because considered as out of bound, but is actually in the middle
if (height > _margin.dx && width > _margin.dx) {
if (right > _layout.width) width = _rect.value.width;

Expand Down

0 comments on commit 63746c7

Please sign in to comment.