-
Notifications
You must be signed in to change notification settings - Fork 77
PAINTROID-790: Create cursor_tool object and provider. #117
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
Open
haske6155
wants to merge
9
commits into
Catrobat:develop
Choose a base branch
from
haske6155:PAINTROID-790
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
048717a
Create cursor_tool object and provider.
haske6155 2a15bf8
delete empty lines
haske6155 0509472
Draw cursor icon as SVG in Stack
haske6155 5b0f921
PAINTROID-790 remove SVG implementation and implement custom painter …
haske6155 54c5e0f
PAINTROID-790 fix undo and flutter analyze errors
haske6155 749ba76
Merge remote-tracking branch 'origin/develop' into PAINTROID-790
haske6155 8d8a537
PAINTROID-790 make build files
haske6155 e0e7923
PAINTROID-790 fix unit tests
haske6155 94be0b6
PAINTROID-790 fix integration tests after logic change
haske6155 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
2 changes: 2 additions & 0 deletions
2
lib/core/commands/command_implementation/graphic/path_command.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'dart:ui'; | ||
|
||
import 'package:paintroid/core/providers/state/canvas_state_provider.dart'; | ||
import 'package:paintroid/core/tools/implementation/cursor_tool.dart'; | ||
import 'package:riverpod_annotation/riverpod_annotation.dart'; | ||
|
||
import 'package:paintroid/core/commands/command_factory/command_factory_provider.dart'; | ||
import 'package:paintroid/core/commands/command_manager/command_manager_provider.dart'; | ||
import 'package:paintroid/core/commands/graphic_factory/graphic_factory_provider.dart'; | ||
import 'package:paintroid/core/enums/tool_types.dart'; | ||
|
||
part 'cursor_tool_provider.g.dart'; | ||
|
||
@riverpod | ||
class CursorToolProvider extends _$CursorToolProvider { | ||
@override | ||
CursorTool build() { | ||
final canvasCenter = ref.read(canvasStateProvider).size.center(Offset.zero); | ||
return CursorTool( | ||
commandManager: ref.watch(commandManagerProvider), | ||
commandFactory: ref.watch(commandFactoryProvider), | ||
graphicFactory: ref.watch(graphicFactoryProvider), | ||
canvasCenter: canvasCenter, | ||
type: ToolType.CURSOR, | ||
); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
lib/core/providers/object/tools/cursor_tool_provider.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When selecting the cursor tool, the paint stroke width isn’t updated. You may need to call
ref.read(paintProvider.notifier).updateStrokeWidth(...)
with the cursor’s stroke width to ensure drawing uses the correct thickness.Copilot uses AI. Check for mistakes.