Skip to content

Refactor/modularization tool draw#45

Open
Abizer-R wants to merge 57 commits intomainfrom
refactor/modularization_tool_draw
Open

Refactor/modularization tool draw#45
Abizer-R wants to merge 57 commits intomainfrom
refactor/modularization_tool_draw

Conversation

@Abizer-R
Copy link
Owner

No description provided.

…& slide-out animations when showing tool-screens (for both top and bottom toolbars).
Abizer-R and others added 27 commits September 14, 2025 21:44
…lso had to move all the related files to fix resolution errors
1. Host app (or legacy façade) shows QuickEditEditor(...) with a QuickEditConfig(tools = listOf(...)).

2. Each tool registers via ToolContribution; tools that adopt the new contract implement ToolContributionWithFactory and provide a ToolFactory.

3. When user selects a tool, shell enters FullScreenTool mode, composes the tool UI, and pauses editor render (no overdraw).

4. Tool emits EditOp via ToolController.emit(op); engine applies and returns a new EditSnapshot; shell exposes it back through ToolHost.snapshot.
…ne.kt instead of accepting a pre-cropped Bitmap.
… model) & applied it in DefaultEditEngine.kt
@Abizer-R
Copy link
Owner Author

@codex review this PR

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +52 to +65
is EditOp.CropImage -> {
val baseBitmap = decode(current.image) ?: return@withContext current
val croppedBitmap = cropBitmapImageSpace(baseBitmap, op.rect)
current.copy(
image = EditImage.FromBitmap(croppedBitmap),
rev = current.rev + 1
)
}

is EditOp.DrawShape -> {
current.copy(
rev = current.rev + 1,
operations = current.operations + op
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve draw operations when cropping without adjusting coordinates

When a crop is applied the engine replaces the backing bitmap but leaves snapshot.operations untouched. Drawn shapes in the list still store coordinates relative to the original image, so after CropImage the subsequent render() call draws those strokes on the cropped bitmap using stale coordinates. Users who draw and then crop will see their strokes shift or render outside the visible area. Either clear the operations list or transform the shape coordinates to the new crop rectangle before pushing the new snapshot.

Useful? React with 👍 / 👎.

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

Successfully merging this pull request may close these issues.

1 participant