timcreatedit / scribble

Scribble is a lightweight library for freehand drawing in Flutter supporting pressure, variable line width and more!
https://pub.dev/packages/scribble
MIT License
115 stars 39 forks source link

feat: line simplification #58

Closed timcreatedit closed 6 months ago

timcreatedit commented 6 months ago

Description

Adds the capability to simplify sketch lines using the new simpli package. This can greatly reduce file size and optimize performance, without sacrificing too much visual fidelity.

https://github.com/timcreatedit/scribble/assets/42270125/c5e3ad7b-ad39-4869-8ec7-d0af6ba325db

Checklist

github-actions[bot] commented 6 months ago

Coverage Report

This is an automatic coverage report for 4ec1348e, proudly generated by Dart Coverage Assistant 🎯🧪.

Monorepo coverage

This repository contains 3 Dart projects. This is is the total coverage across all of them:

39.56043956043956% - pass ⬆️ +7.06%

scribble

Scribble is a lightweight library for freehand drawing in Flutter

16.666666666666664% - warning ⬆️ +11.30%

Coverage Details for scribble | File | Line Percentage | Line Count | | --- | --- | --- | | **lib/src/domain** | | | | iterable_removed_x.dart | 100.00 | 15 | | **lib/src/domain/model/point** | | | | point.dart | 100.00 | 2 | | point.g.dart | 44.44 | 9 | | **lib/src/domain/model/sketch** | | | | sketch.dart | 100.00 | 1 | | sketch.g.dart | 57.14 | 7 | | **lib/src/domain/model/sketch_line** | | | | sketch_line.dart | 100.00 | 2 | | sketch_line.g.dart | 58.33 | 12 | | **lib/src/view** | | | | scribble.dart | 0.00 | 30 | | scribble_sketch.dart | 0.00 | 6 | | pan_gesture_catcher.dart | 0.00 | 16 | | **lib/src/view/notifier** | | | | scribble_notifier.dart | 9.74 | 154 | | **lib/src/view/painting** | | | | point_to_offset_x.dart | 0.00 | 1 | | sketch_line_path_mixin.dart | 0.00 | 24 | | scribble_editing_painter.dart | 0.00 | 23 | | scribble_painter.dart | 0.00 | 10 | | **lib/src/view/simplification** | | | | sketch_simplifier.dart | 100.00 | 15 | | **lib/src/view/state** | | | | scribble.state.dart | 6.25 | 16 | | scribble.state.g.dart | 0.00 | 53 |

simpli

Polyline simplification algorithms, made simple! Sporting exciting algorithms such as Ramer-Douglas-Peucker and Visvalingam.

100% - pass ➡️ 0.00%

Coverage Details for simpli | File | Line Percentage | Line Count | | --- | --- | --- | | **lib/src/data** | | | | utils.dart | 100.00 | 10 | | visvalingam_simplifier.dart | 100.00 | 42 | | rdp_simplifier.dart | 100.00 | 18 |

value_notifier_tools

Helpful lightweight tools for working with ValueNotifiers

100% - pass ➡️ 0.00%

Coverage Details for value_notifier_tools | File | Line Percentage | Line Count | | --- | --- | --- | | **lib/src/history_value_notifier** | | | | history_value_notifier.dart | 100.00 | 1 | | history_value_notifier_mixin.dart | 100.00 | 45 | | **lib/src/select_value_notifier** | | | | select_value_notifier.dart | 100.00 | 12 | | **lib/src/where_value_notifier** | | | | where_value_notifier_mixin.dart | 100.00 | 7 | | where_value_notifier.dart | 100.00 | 1 | | where_value_notifier_from_parent.dart | 100.00 | 14 |