summaryrefslogtreecommitdiff
path: root/Userland/Applications/PixelPaint
AgeCommit message (Collapse)Author
2021-11-08PixelPaint: Use ErrorOr<T> for Image and Layer creation helpersAndreas Kling
2021-11-08PixelPaint: Use ErrorOr<T> for Image::try_compose_bitmap()Andreas Kling
2021-11-08PixelPaint: Use ErrorOr<T> for Image writing/exporting functionsAndreas Kling
2021-11-08LibCore: Use ErrorOr<T> for Core::File::open()Andreas Kling
2021-11-08AK: Use ErrorOr<T> for MappedFile factoriesAndreas Kling
Replace Result<T, E> with ErrorOr<T> and propagate the error to callers.
2021-11-08LibGfx: Use ErrorOr<T> for Bitmap::try_create()Andreas Kling
Another one that was used in a fajillion places.
2021-11-08LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()Andreas Kling
This was used in a lot of places, so this patch makes liberal use of ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-11-08LibGfx: Use ErrorOr<T> for Bitmap::cropped()Andreas Kling
2021-11-08LibGfx: Use ErrorOr<T> for Bitmap::flipped()Andreas Kling
2021-11-08LibGfx: Use ErrorOr<T> for Bitmap::rotated()Andreas Kling
2021-11-08LibGfx: Use ErrorOr<T> for Bitmap::clone()Andreas Kling
2021-11-03Applications: Remove border from GroupBox marginsFrHun
2021-11-02Applications: Fix visibility of Object-derivative constructorsBen Wiederhake
Derivatives of Core::Object should be constructed through ClassName::construct(), to avoid handling ref-counted objects with refcount zero. Fixing the visibility means that misuses like this are more difficult.
2021-11-02PixelPaint: Map color_distance_squared from 0 to 1Musab Kılıç
2021-10-31PixelPaint: Use a bucket cursor for the Bucket toolMarco Cutecchia
2021-10-31PixelPaint: Support using a bitmap as a tool's cursorMarco Cutecchia
2021-10-27Everywhere: Rename left/right-click to primary/secondaryFiliph Sandström
This resolves #10641.
2021-10-24PixelPaint: Move Mask::{get, set, to_index} to the header fileIdan Horowitz
They were previously taking up 9% of samples in a profile of PixelPaint while selecting a mask, and as a result of moving them to the header they were inlined, which effectively eliminated them from the profile.
2021-10-23AK+Everywhere: Make Base64 decoding fallibleBen Wiederhake
2021-10-16PixelPaint: Create an empty layer when the last layer is removedFelix Rauch
Previously, when the last layer got deleted, the active layer was set to nullptr, causing a crash. Now, we create a new transparent background layer with the image dimensions instead.
2021-10-07PixelPaint: Close tab now prompts for a saveAlex Major
2021-10-07PixelPaint: Use reorderable tabsLuke Wilde
2021-10-05PixelPaint: Fix first undo action not workingMarco Cutecchia
2021-10-05PixelPaint: Ensure a layer is selected when restoring a snapshotMarco Cutecchia
Previously when restoring the starting snapshot in the UndoStack we would end up with no layer selected, which was kinda annoying
2021-10-02PixelPaint: Correctly offset stroke position for even thicknessesGal Horowitz
2021-10-02PixelPaint: LayerListWidget::set_selected_layer now handles nullptrGal Horowitz
2021-09-29PixelPaint: Add new icons for layer actionsMarcus Nilsson
Add icons for three more layer actions.
2021-09-25PixelPaint: Close image tabs on middle clickKarol Kosek
2021-09-25PixelPaint: Close New Image dialog after pressing return keyKarol Kosek
13e526de43847ac86d74e3cb0be2d6b930f1d46f added the feature to new Layer dialog. This patch adds it to Image dialog to stay consistent across the app. :^)
2021-09-20PixelPaint: Move Tools to it's own subdirectoryMarcus Nilsson
The PixelPaint source directory was getting a bit large, let's move all the Tools to it's own subdirectory. Also remove some unused includes.
2021-09-19PixelPaint: Use main window's icon in the 'Create new image' widgetKarol Kosek
2021-09-17PixelPaint: Allow selecting a custom aspect ratio for RectangleToolMustafa Quraish
If you enter a custom aspect ratio, and are not holding down shift, the rectangle will be constrained to the entered aspect ratio
2021-09-17PixelPaint: Allow selecting a custom aspect ratio for EllipseToolMustafa Quraish
If you enter a custom aspect ratio, and are not holding down shift, the bounding rect for the ellipse will be constrained to the entered aspect ratio
2021-09-17LibGfx+PixelPaint: Add `Point::end_point_for_aspect_ratio` methodMustafa Quraish
Previously we only had `Point::end_point_for_square_aspect_ratio`, which was convenient for PixelPaint but assumed the aspect ratio was always fixed at 1. This patch replaces it with a new mthod that takes in an arbitrary aspect ratio and computes the end point based off that. There's some explicit casting going on in `Point.cpp` to ensure that the types line up, since we're templating Point based on `T`.`
2021-09-16PixelPaint: Implement automatic scrolling in LayerListWidgetMarcus Nilsson
The previous implementation of automatic scrolling in LayerListWidget relied on mousemove events to perform the scrolling, which didn't produce the expected behavior. Instead use the new auto scroll timer.
2021-09-16PixelPaint: Tweak layer/tool properties widget heightsMarcus Nilsson
There's no use for these two to be larger than necessary when resizing the window.
2021-09-16PixelPaint: Don't select the same layer twice in LayerListWidgetMarcus Nilsson
Without this check we would do an unnecessary partial second round trip because of the call chain: LayerListWidget::set_selected_layer() -> LayerListWidget::on_layer_select() -> ImageEditor::set_active_layer() -> ImageEditor::on_active_layer_change() -> LayerListWidget::set_selected_layer()
2021-09-16PixelPaint: Don't update ImageEditor in set_active_layer()Marcus Nilsson
Setting the active layer does not cause anything to render differently. Thus no update is needed and the call to layers_did_change() is unnecessary.
2021-09-15PixelPaint: Add ability to draw squares and circlesZyper
Shift-key modifier for tools forces square aspect ratio. It allows drawing squares with Rectangle Tool and circles with Ellipse Tool.
2021-09-13Everywhere: Use my fancy new serenityos.org email :^)Mustafa Quraish
2021-09-13PixelPaint: Make CloneTool change cursor temporarily while selectingMustafa Quraish
This just provides some nice visual feedback when you are in the middle of selecting a color. An eyedropper might not be the ideal choice here, but among the cursors we already have it is the best one.
2021-09-13PixelPaint: Add `ImageEditor::update_tool_cursor()` methodMustafa Quraish
This just allows us to ask the image editor to update the tool's current cursor. This is useful in cases where a tool may want to change it's cursor for some operation, and wants to invalidate the active cursor cached in the ImageEditor.
2021-09-13PixelPaint: Add a marker for CloneTool's selected positionMustafa Quraish
Now we add a little marker to show the current sample position of the CloneTool. The current implementation for updating the cursor location is really dumb since it just updates the whole editor, but that's a yak on the stack to fix.
2021-09-13PixelPaint: Incorporate CloneTool into toolboxMustafa Quraish
2021-09-13PixelPaint: Add Clone Tool :^)Mustafa Quraish
There's still a lot to be desired in terms of functionality and usability, but this is a start. When using the clone tool, you can press Alt to sample a location, and then the brush will clone the color from there.
2021-09-13PixelPaint: Fix Line/Rectangle second paint alignment with pixelsMustafa Quraish
The problem was a bit more complex than originally anticipated, and the root of the problem is that the "coordinates" of a pixel are actually the top left of the pixel, and when we're really zoomed in, the difference in editor coordinates of the top-left and the center of the pixel is significant. So, we need to offset the "start" point when we are painting on the editor to account for this, based on the current scale. This patch adds a `editor_stroke_position` in `Tool` which can be used to compute what point (in editor coords) we should use for a given pixel and it's corresponding stroke thickness. Note that this doesn't really work well with the ellipse, since that is drawn with a different mechanism. Using this new method with the `EllipseTool` seems to give the same (or slightly worse) results, so I have not changed anything there for now.
2021-09-13PixelPaint: Call `Layer::did_modify_bitmap()` after drawing EllipseMustafa Quraish
Previously, Any potential ImageClients would not have received an update about the layer bitmap having been modified. This is similar to what the other shape tools do upon completion.
2021-09-13PixelPaint: Update editor after drawing shapes to clear outsideMustafa Quraish
Previously, we didn't ask the editor to update after drawing a Rectangle/Line. This meant that if any part of your shape went outside the bounds of the image, that part would not be cleared out until the next update of the editor.
2021-09-13PixelPaint: Ensure thickness of shapes is never 0 when drawingMustafa Quraish
When drawing a line/rectangle/ellipse in `Tool::on_second_paint()`, if `m_thickness * m_editor->scale()` was less than one, it would get converted to 0 because of truncation. This was causing infinite loops somewhere in the painter code and causing the application to freeze. Fixes #9986.
2021-09-13PixelPaint: Allowing drawing line from center, like other shapesMustafa Quraish
You could draw a Rectangle/Ellipse from the center by pressing down the Alt key, but this was missing for lines. This commit adds it in to keep consistency among the different shapes.