forked from boostcampwm-2024/web30-stop-troublepainter
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Enhance drawing with Bezier curve interpolation #13
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
Merged
Conversation
This file contains hidden or 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
β¦ation - StrokeBuffer class using Catmull-Rom spline interpolation for smooth drawing
- Create standalone DrawingTest component for testing drawing functionality without game state - Add dedicated route '/drawing-test' for testing canvas interactions - Implement cursor canvas reference and coordinate scaling for accurate drawing
- Implement - Add quadraticCurveTo for smoother line drawing in `drawStroke` - Update point management system to handle 3-point curve generation in `continueDrawing` - Problem : System creates duplicate line - Current logic keeps three points (prev-prev, prev, current) - When new point arrives, prev becomes prev-prev - This causes each curve section to be drawn twice
- Add - Custom Bezier curve control point calculation with tension - Adaptive curve rendering based on point count - Fix - Update point buffer to maintain 4 points for cubic Bezier curves - Remove quadraticCurveTo and add bezierCurveTo that caused duplicate line issues
- Modify control point calculation using Catmull-Rom spline formula - Higher tension now results in tighter curves, matching intuitive behavior
3 tasks
|
π Storybook preview deployed to: Visit Storybook Preview |
- Simplify logic by replacing cubic Bezier curves with quadratic curves - Improve performance with bit-shifting for midpoint calculations - Remove redundant control point computations - Maintain smooth curve quality while reducing computational overhead This change improves drawing performance while keeping the same visual quality by leveraging quadratic curves instead of cubic Bezier curves for path rendering.
|
π Storybook preview deployed to: Visit Storybook Preview |
|
π Storybook preview deployed to: Visit Storybook Preview |
|
π Storybook preview deployed to: Visit Storybook Preview |
kwaksj329
approved these changes
Jan 23, 2025
choiseona
approved these changes
Jan 23, 2025
|
π§Ή Storybook preview for PR #13 has been removed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π μμ λ΄μ©
closes #12
π‘ μμΈν μ€λͺ
κΈ°μ‘΄
quadraticCurveToλ°©μμ κ° μ μ΄ μλ‘μ΄ κ³‘μ μ μμμ μΌλ‘ μ¬μ¬μ©λλ©΄μ μ μ΄ μ€λ³΅μΌλ‘ κ·Έλ €μ§λ λ¬Έμ κ° μμμ΅λλ€. ν΄κ²°ν΄λ κ°μ΄ κ³μ μ§λ νμμ λ°μνμ΅λλ€.μ΄λ₯Ό ν΄κ²°νκΈ° μν΄ λ€μκ³Ό κ°μ λ°©μμΌλ‘ κ°μ νμ΅λλ€.
π© νμ μμ
β μ ν 체ν¬λ¦¬μ€νΈ
mainμ΄ μλλλ€.)