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

PAINTROID-432: Implement clipping tool to erase background more easily #1125

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

Electronix1337
Copy link
Contributor

@Electronix1337 Electronix1337 commented Jun 28, 2022

This PR is the main work of my GSoC 2022.

I've Implemented a new tool called "clip area/clipping tool" with which the user is able to mark an area and when applying the tool or switching to another tool with a marked area already drawn, everything except the marked area will be erased. The path for the marked area can have any color but depending on the tool color, the path either has a white contour (when black is the current tool color) or black otherwise.

In order to have an actual closed area to properly clip I decided to do the same as i.e. Photoshop and just draw a last line from the last coordinate (where the user released the finger) to the initial coordinate to have an actual closed marked area to clip. I did not find out yet why sometimes the line is an actual line and sometimes the patheffect of the toolpaint actually applies and a dashed line will be drawn.

  • When marked area is already drawn and user tries to draw another area the old area will just be deleted and the new area will be drawn on the canvas.
  • When marked area is drawn and user presses undo, the marked area will just be deleted.
  • When marked area is drawn and applied and user presses undo, the bitmap before clipping will be displayed, as the path command for the marked area will be deleted from the undo/redo list, also color changes will not be undo/redo-able as discussed with Wolfgang.
Click for demo on black bitmap with undo and redo:
Click for demo on pink bitmap with redrawing marked area and color change:
Click for demo on actual face:

https://jira.catrob.at/browse/PAINTROID-432

  • Include the name of the Jira ticket in the PR’s title
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing unit tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Stick to the project’s gitflow workflow
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Post a message in the #paintroid Slack channel and ask for a code reviewer

@Electronix1337 Electronix1337 force-pushed the PAINTROID-432 branch 10 times, most recently from 81317fe to 732483f Compare July 5, 2022 08:58
@Electronix1337 Electronix1337 force-pushed the PAINTROID-432 branch 5 times, most recently from a190a70 to fb90bb4 Compare July 7, 2022 13:29
Copy link
Contributor

@FromG FromG left a comment

Choose a reason for hiding this comment

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

pls change the requested changes.

@Electronix1337 Electronix1337 force-pushed the PAINTROID-432 branch 2 times, most recently from e804abd to 520c87e Compare July 12, 2022 09:09
Implemented new "clipping" tool where user can mark one or several areas and then apply the tool which erases everything except the marked areas.
Copy link
Contributor

@FromG FromG left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@wslany wslany left a comment

Choose a reason for hiding this comment

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

Thanks!

@wslany wslany merged commit cf3859b into Catrobat:develop Jul 18, 2022
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.

3 participants