-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Group slide action buttons * Fix layer row clipping * Build group line * Build line * Add layer group to save data * Change save data format * Setup sync layers test * Pass tests * Test appending to secondary * Non null stroke * Loaded bool * Readability * Refactor tests * Better test output * Pass test * Pass test * Longer wins * Refactor before optimization * Refactor * Recursive refactor and todo * Sync playmode * Test if appended are empty * YAGNI * Non null width and height * Just load empty image into mem as before * Pass test * Renume redundant null operators * Fix broken tests * Use loaded constructor * File must always exist * Line padding * Remove bangs * Layer groups list getter * Flush line to the side * Indent grouped * Refactor * Build group lines from state * Implement group actions * Fix line position * Layer group actions buttons based on context * Sync layers within a group on drawing page * Merge layer groups * Await for merge group * Extract sharedPref, test for delete bug * Refactor test * Fix delete layer bug * Delete logic for groups * Pass tests * Test adding to group when sandwich * Pass test * Test keeping layers in sync on add * Pass test * Show number only for selected * Bottom padding * Finish adding layer before adding another one * Test handling groups on reorder * Pass test * Pass another test * Pass test * Pass another test for moving outside the group * Refactor * Pass last test * Refactor * Refactor * Fix active reel index * Extract layers getter * Change icons * Animated padding * Make group line more obvious * Extract group line * Hide line on reordering * Transparent material on reorder * Trigger reordering end when layerer is dropped in the same place * Rename to sync and detach * Fade out group line on reorder * Refactor * Preserve auto scroll on reorder * Fix group lines on rotation * Update flutter * Keep group lines aligned with its group at all times * Fix path collision on adding frames to synced layers * Optimize bracket painting * Clip brackets outside bounds * Allow timeline pinching over buttons * Scene layer methods * Image interface * Use image interface in image sliver * Painted glass * Use getter * Scene layer group * Frame interface * One interface for frame and composite frame * Simplify composite image constructor * Remove unnecessary ghost frames getter * Rename to getFrames * Replace with frame interface * Timeline scene layer interface * Implement interface * Implement Scene layer group * Partially integrate scene layer interface * Timeline folder * Timeline row interface * Group row interfaces in one file * Scene row interface * Implement timeline scene row * Scene row object * Rename var * Combine layers on timeline * Fix group visibility toggle * Fix duplicate * Fix delete * Update mini reel frame when paiting * Base image * Just pass image * Dispose of all in history stack, since flushed snapshots are cloned * Add smaller brush size * Rename * Show composite frame in delete dialog * Remove unnecessary clone calls * Document usage of clone for diskimage * Dispose on delete * Move draw with finger state * Refactor * Blend layers only when necessary * Fix a bug where short strokes disappear * Copy all properties when duplicating scene layer * Remove override * Release notes * Bump version
- Loading branch information
1 parent
d24847e
commit 2946966
Showing
83 changed files
with
2,255 additions
and
645 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
abstract class BaseImage extends ChangeNotifier with EquatableMixin { | ||
int get width; | ||
int get height; | ||
|
||
Size get size => Size(width.toDouble(), height.toDouble()); | ||
|
||
void draw(Canvas canvas, Offset offset, Paint paint); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import 'package:mooltik/common/data/project/base_image.dart'; | ||
import 'package:mooltik/common/data/sequence/time_span.dart'; | ||
|
||
abstract class FrameInterface implements TimeSpan { | ||
BaseImage get image; | ||
Duration get duration; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:mooltik/common/data/project/composite_frame.dart'; | ||
import 'package:mooltik/common/data/project/composite_image.dart'; | ||
import 'package:mooltik/drawing/data/frame/frame.dart'; | ||
|
||
CompositeFrame combineFrames(Iterable<Frame> frames) { | ||
assert(frames.isNotEmpty); | ||
assert(frames.every((frame) => frame.duration == frames.first.duration)); | ||
|
||
final images = frames.map((frame) => frame.image).toList(); | ||
return CompositeFrame(CompositeImage(images), frames.first.duration); | ||
} | ||
|
||
Iterable<CompositeFrame> combineFrameSequences( | ||
Iterable<Iterable<Frame>> frameSequences, | ||
) sync* { | ||
assert(frameSequences.isNotEmpty); | ||
|
||
final iterators = | ||
frameSequences.map((sequence) => sequence.iterator).toList(); | ||
|
||
while (iterators.every((iterator) => iterator.moveNext())) { | ||
yield combineFrames(iterators.map((iterator) => iterator.current)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:mooltik/common/data/project/frame_interface.dart'; | ||
import 'package:mooltik/common/data/project/layer_group/combine_frames.dart'; | ||
import 'package:mooltik/common/data/sequence/sequence.dart'; | ||
import 'package:mooltik/drawing/data/frame/frame.dart'; | ||
import 'package:mooltik/drawing/data/frame_reel_model.dart'; | ||
|
||
/// Wrapper around `FrameReelModel` to keep grouped layers in sync. | ||
class FrameReelGroup extends ChangeNotifier implements FrameReelModel { | ||
FrameReelGroup({ | ||
required this.activeReel, | ||
required this.group, | ||
}); | ||
|
||
final FrameReelModel activeReel; | ||
final List<FrameReelModel> group; | ||
|
||
@override | ||
Sequence<Frame> get frameSeq => activeReel.frameSeq; | ||
|
||
@override | ||
Frame get currentFrame => activeReel.currentFrame; | ||
|
||
@override | ||
FrameInterface get deleteDialogFrame => | ||
combineFrames(group.map((reel) => reel.currentFrame)); | ||
|
||
@override | ||
int get currentIndex => activeReel.currentIndex; | ||
|
||
@override | ||
void setCurrent(int index) { | ||
group.forEach((reel) => reel.setCurrent(index)); | ||
notifyListeners(); | ||
} | ||
|
||
@override | ||
Future<void> appendFrame() async { | ||
await Future.wait(group.map((reel) => reel.appendFrame())); | ||
notifyListeners(); | ||
} | ||
|
||
@override | ||
Future<void> addBeforeCurrent() async { | ||
await Future.wait(group.map((reel) => reel.addBeforeCurrent())); | ||
notifyListeners(); | ||
} | ||
|
||
@override | ||
Future<void> addAfterCurrent() async { | ||
await Future.wait(group.map((reel) => reel.addAfterCurrent())); | ||
notifyListeners(); | ||
} | ||
|
||
@override | ||
Future<void> duplicateCurrent() async { | ||
await Future.wait(group.map((reel) => reel.duplicateCurrent())); | ||
notifyListeners(); | ||
} | ||
|
||
@override | ||
bool get canDeleteCurrent => activeReel.canDeleteCurrent; | ||
|
||
@override | ||
void deleteCurrent() { | ||
group.forEach((reel) => reel.deleteCurrent()); | ||
notifyListeners(); | ||
} | ||
} |
Oops, something went wrong.