Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintainer wanted! #10

Closed
steveruizok opened this issue Mar 31, 2023 · 13 comments
Closed

Maintainer wanted! #10

steveruizok opened this issue Mar 31, 2023 · 13 comments

Comments

@steveruizok
Copy link
Owner

Hello, I'd like to find a new maintainer for this library. I wrote this port of my JavaScript perfect-freehand algorithm as a learning exercise, however I now see that it has been picked up fairly well within the Flutter community.

If you would like to help maintain the library, please let me know in this issue or at steve@tldraw.com.

Specifically, I'd like to find a maintainer who would be interested in improving its examples, keeping it modern with respect to the Dart language, and keeping it more or less at parity with the JavaScript version. If you'd like to make improvements to the core algorithm, then that would be good too!

Either way, thanks for checking out perfect-freehand, I hope you've found it useful!

@hereket
Copy link

hereket commented Mar 31, 2023

Hello. I would love to.

@logickoder
Copy link

I would love to be a maintainer

@matthew-carroll
Copy link
Contributor

@steveruizok The Flutter Bounty Hunters are still available to take over the package. We discussed that a little less than a year ago. www.FlutterBountyHunters.com

@bansalgaurav852
Copy link

I would love to be a maintainer.

@adil192
Copy link
Collaborator

adil192 commented Oct 4, 2023

@steveruizok I've re-ported the steveruizok/perfect-freehand repo to dart from scratch.
You can find the repo here: adil192/perfect_freehand

It's therefore fully up to date with the js version. I'm going to do a little bit more testing but I'm planning for this to be a drop-in replacement for steveruizok/perfect-freehand-dart (maybe even replacing the perfect_freehand package on pub.dev).

@steveruizok
Copy link
Owner Author

Wow! If this is better than what's here in the repo, I'd be happy to discuss bringing that code here and making you a maintainer.

@adil192
Copy link
Collaborator

adil192 commented Oct 4, 2023

Update: I've got the demo running now! https://adil192.github.io/perfect_freehand/

@adil192
Copy link
Collaborator

adil192 commented Oct 9, 2023

I've now added some golden file tests for some of the sample inputs from the js repo.

image

However, the two_equal_points.png file is blank. Can you help me figure out why?

I found a bug in my repo where trying to normalize the zero vector would return NaN and throw an error. I patched it by simply returning the zero vector if the length is 0: adil192/perfect_freehand@8ea5c5f.
This NaN bug only happened with the two_equal_points.dart sample input, so maybe this could be the culprit?

For the two_equal_parts.dart file, the output is

[Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0), Offset(1.0, 1.0)]

or before the patch it was:

[Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN), Offset(NaN, NaN)]

@adil192
Copy link
Collaborator

adil192 commented Nov 6, 2023

@steveruizok
I fixed the above edge case with adil192/perfect_freehand@0bb5a99.
I would say my repo is ready to be copied into this repo now if you're ready :)

@alestiago
Copy link

What's the status of this? Who is maintaining this repository? Is this still the main repository or has it been moved elsewhere?

@adil192
Copy link
Collaborator

adil192 commented Jan 5, 2024

What's the status of this? Who is maintaining this repository? Is this still the main repository or has it been moved elsewhere?

Use the package on pub.dev for now.
There aren't any major new features or fixes in the new port, but I believe it has a friendlier API that'll also cut down on wrapper code in dependent projects (like how I needed to implement a StrokeOptions class in Saber).

This (steveruizok/perfect-freehand-dart) is still the main repo. I was waiting for steveruizok's response but I've just made the PR now.
If we can't get the updates merged into this repo, I'll publish it to pub.dev as a separate package.

@steveruizok
Copy link
Owner Author

Emailed you @adil192! Sorry all for lack of attention here.

@adil192
Copy link
Collaborator

adil192 commented Jan 10, 2024

@steveruizok Are we happy to close this issue?

adil192 added a commit that referenced this issue Feb 6, 2024
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'dart:ui/lerp.dart': Failed assertion: line 19 pos 10: '<optimized out>': Cannot interpolate between finite and non-finite values
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      lerpDouble (dart:ui/lerp.dart:19:10)
#3      PointVector.lerp (package:perfect_freehand/src/types/point_vector.dart:54:7)
#4      getStrokeOutlinePoints (package:perfect_freehand/src/get_stroke_outline_points.dart:238:31)
#5      getStroke (package:perfect_freehand/src/get_stroke.dart:19:10)
#6      Stroke._getPolygon (package:saber/components/canvas/_stroke.dart:200:21)
#7      Stroke._updatePolygon (package:saber/components/canvas/_stroke.dart:48:16)
#8      Stroke.polygon (package:saber/components/canvas/_stroke.dart:38:32)
#9      Stroke.toSvgPath (package:saber/components/canvas/_stroke.dart:247:9)
#10     EditorExporter.generatePdf.<anonymous closure>.<anonymous closure> (package:saber/data/editor/editor_exporter.dart:111:52)
#11     CustomPaint.paint (package:pdf/src/widgets/basic.dart:623:25)
#12     SingleChildWidget.paintChild (package:pdf/src/widgets/widget.dart:320:14)
#13     ConstrainedBox.paint (package:pdf/src/widgets/basic.dart:449:5)
#14     StatelessWidget.paint (package:pdf/src/widgets/widget.dart:260:15)
#15     Page.paint (package:pdf/src/widgets/page.dart:246:13)
#16     Page.postProcess (package:pdf/src/widgets/page.dart:179:5)
#17     Document.save (package:pdf/src/widgets/document.dart:130:14)
#18     EditorState.exportAsPdf (package:saber/pages/editor/editor.dart:1213:72)
<asynchronous suspension>
#19     _ExportBarState._onPressed.<anonymous closure>.<anonymous closure> (package:saber/components/toolbar/export_bar.dart:38:29)
<asynchronous suspension>
@adil192 adil192 closed this as completed Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants