1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 23:15:07 +00:00
Commit graph

121 commits

Author SHA1 Message Date
Ethan Yeager
bf5a18babb PixelPaint: Correct gradient tool's position during preview 2023-04-14 13:42:45 +01:00
Tim Ledbetter
5b84fafbca PixelPaint: Include possible errno description in error messages
In the case where an error is created from an errno, calling
string_literal() will print nothing. Using Error's formatter
instead gives a more descriptive error message.
2023-03-26 00:47:29 +01:00
Tim Ledbetter
55feecee36 PixelPaint: Make wand tool work when layer and image rects differ
Previously, the position of the mask used to calculate the new
selection did not match the position of the active layer. The program
would crash when trying to set a mask pixel outside the bounds of the
active layer.
2023-03-26 00:21:29 +01:00
Tim Ledbetter
bdaad815a1 PixelPaint: Rename Layer::resize() to Layer::scale()
This name more accurately describes the transform being performed.
2023-03-16 10:00:26 +01:00
Tim Ledbetter
8ffe91c2f7 PixelPaint: Make the clone tool brush size consistent with other tools
Other brush tools treat the brush size as a radius, not diameter. The
clone tool now does the same.
2023-03-15 23:56:47 +01:00
Tim Ledbetter
8fa6a85100 PixelPaint: Scale the clone tool sample marker size with zoom level 2023-03-15 23:56:47 +01:00
Tim Ledbetter
da0ec8e635 PixelPaint: Repaint clone tool sample marker on size change 2023-03-15 23:56:47 +01:00
Tim Ledbetter
9f75c2b075 PixelPaint: Minimize clone tool sample marker repaints
This removes 2 FIXMEs :^)
2023-03-15 23:56:47 +01:00
Lucas CHOLLET
b5594bf9a2 PixelPaint: Display color information on mousemove with the PickerTool
Per-channel values of the pixel color are now displayed in the status
bar when the PickerTool is selected. This information obviously updates
on mousemove.
2023-03-12 22:08:24 +01:00
Andreas Kling
8a48246ed1 Everywhere: Stop using NonnullRefPtrVector
This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.

This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-03-06 23:46:35 +01:00
Tim Ledbetter
e33791502f PixelPaint: Do not change layers when scaling with the move tool
The move tool will no longer change the foreground layer if the cursor
is currently hovering over a resize anchor.
2023-03-01 08:15:46 +00:00
Linus Groh
09d40bfbb2 Everywhere: Use _{short_,}string to create Strings from literals 2023-02-25 20:51:49 +01:00
Andreas Kling
33e87d1627 Userland: Fix remaining smart pointer const-correctness issues 2023-02-21 00:54:04 +01:00
Andreas Kling
df07416171 PixelPaint: Store tool cursors as NNRP<Gfx::Bitmap const> 2023-02-21 00:54:04 +01:00
Tim Ledbetter
3d9ba87077 PixelPaint: Enable more text tool keyboard shortcuts
This commit allows the text tool's internal TextEditor component to
handle keyboard shortcuts that would normally be handled by menu
actions.

The shortcuts that can now be used are: cut, copy, paste, undo, redo
and select all.
2023-02-19 01:48:14 +01:00
Sam Atkins
6b66e39df4 LibGUI+Userland: Stop returning Layout from Widget::(try_)set_layout()
Nobody uses this return value any more. It also lets us remove a whole
bunch of `(void)` casts. :^)
2023-02-18 16:56:56 +00:00
Sam Atkins
9561ec15f4 Userland: Use Widget::add_spacer() everywhere 2023-02-18 16:56:56 +00:00
Karol Kosek
be717edd33 PixelPaint: Propagate errors from making tool property widgets 2023-02-16 23:36:58 +00:00
Karol Kosek
83da3c5c3e PixelPaint: Add an option for making a Gradient with a secondary color 2023-02-16 10:50:58 +00:00
Karol Kosek
1ce2d7e674 PixelPaint: Put the main gradient color at the cursor
It doesn't seem right to me that we are 'holding' a transparent color,
with the main color being on the opposite side.
2023-02-16 10:50:58 +00:00
Karol Kosek
d27d19f012 PixelPaint: Set Tool on_*_color_change logic using virtual functions
Previously, we were rewriting the on_primary_color_change in the Text
Tool and Gradient, which made the palette widget no longer update after
picking a color from an image. Additionally, it also crashed the program
after leaving the Gradient tool and trying to change color.
2023-02-16 10:50:58 +00:00
Karol Kosek
e39adc4772 Userland: Set Button text using the new String class 2023-02-13 00:45:09 +00:00
Karol Kosek
d32b052f22 LibGUI+Userland: Add _deprecated suffix to AbstractButton::{set_,}text 2023-02-13 00:45:09 +00:00
Karol Kosek
67ffc687d8 LibGUI+PixelPaint: Port GUI::ValueSlider's suffix to the new String 2023-02-13 00:26:39 +00:00
Tim Ledbetter
4b604f702e PixelPaint: Correct move tool alignment with the layer boundary
Previously, the move tool outline could "wobble" relative to the layer
boundary. This caused the layer boundary to appear and disappear when
zooming. With this commit, the layer boundary is always drawn behind
the move tool outline.
2023-02-08 20:29:48 +01:00
Tim Ledbetter
cc18d6fd25 PixelPaint: Use image coordinates for bucket tool bounds checking
Previously, layer coordinates were being used to check whether the
bucket tool was within the bounds of the current selection, rather
than image coordinates.
2023-02-08 20:28:55 +01:00
Tim Ledbetter
d4cb089acb PixelPaint: Update text tool font color on primary color change 2023-02-02 14:41:59 +01:00
Tim Ledbetter
9115e99e4b PixelPaint: Scale move tool resize anchors
The areas where the user must click to resize the image are now
scaled to ensure they do not overlap. This allows us to display the
correct cursor when zoomed out, as well as making the
borders look nicer.
2023-02-02 14:40:17 +01:00
Tim Ledbetter
c82825379a PixelPaint: Show resize anchors when using the move tool
This commit adds a two color border around areas that the user must
drag to resize, when using the move tool.
2023-02-02 14:40:17 +01:00
Tim Ledbetter
4c617d370e PixelPaint: Highlight active layer when using the move tool
This commit adds a two color border around the currently selected
layer when using the move tool.
2023-02-02 14:40:17 +01:00
Tim Ledbetter
7b3bc883f1 PixelPaint: Set initial position correctly when using the move tool
This fixes an issue, where single clicking in the corner of the image
without moving the mouse would cause the layer to jump to the top left
corner of the canvas.
2023-02-02 14:40:17 +01:00
MacDue
69580d7f0e PixelPaint: Allow the gradient tool to work with selections
Previously the call to layer->did_modify_bitmap() was missing so the
selection was not applied.
2023-01-27 18:05:19 +00:00
MacDue
681ed93a41 PixelPaint: Fix gradient tool clipping issues
This ensures that the gradient does not paint over the rulers at
any zoom level, and also shows the guidelines/handles even when the
gradient is clipped.
2023-01-27 18:05:19 +00:00
Tim Schumacher
82a152b696 LibGfx: Remove try_ prefix from bitmap creation functions
Those don't have any non-try counterpart, so we might as well just omit
it.
2023-01-26 20:24:37 +00:00
Tim Ledbetter
77e15ff4da PixelPaint: Let the move tool optionally select the active layer
Previously, the move tool would always select the topmost layer before
performing a move operation. This commit adds an option for the move
tool to always select the active layer, even if it is behind another.
2023-01-26 14:00:14 +01:00
Torstennator
452285a3f8 PixelPaint: Add a GradientTool
This patch adds a new gradient tool to pixelpaint that allows us to fill
the canvas with a smooth color gradient outline at the edge of the
filled area.
2023-01-26 10:37:26 +00:00
Tim Ledbetter
dd582e4ae3 PixelPaint: Hold shift to increase move tool speed with the arrow keys
Holding shift while using the move tool with the arrow keys now moves
the selected layer in 10 pixel increments.
2023-01-15 19:11:25 +01:00
Tim Ledbetter
ecc202c59d PixelPaint: Hold shift to constrain polygonal select tool line angle
Holding shift while using the polygonal select tool now constrains the
line angle in 22.5 degree increments. This matches the behavior of the
line tool.
2023-01-13 15:52:57 +01:00
Tim Ledbetter
569ef94228 PixelPaint: Don't allow the move tool to resize to zero pixels
This prevents an error message appearing when we attempt to scale
a layer to zero pixels using the move tool.
2023-01-13 15:45:28 +01:00
Tim Ledbetter
b0fad409bf PixelPaint: Scale lasso tool preview path on zoom level change
The size of the preview shown by the lasso tool now scales with the
current zoom level.
2023-01-12 11:29:10 +01:00
Sam Atkins
e181b1cb82 Userland: Use Core::Timer::create_foo() factory functions where possible 2023-01-12 11:25:51 +01:00
Tim Ledbetter
6b3688147f PixelPaint: Fix typo in variable name 2023-01-06 15:09:56 +00:00
Tim Ledbetter
a30b956e94 PixelPaint: Allow move tool to scale in all directions
It is now possible to scale the current layer using the move tool from
all four corners of the layer boundary. Previously scaling was only
possible from the bottom right of the image.
2023-01-06 15:09:56 +00:00
Tim Ledbetter
0cf29f6c45 PixelPaint: Draw polygonal select tool lines with two colors
This stops lines from disappearing when entering a dark area of the
image.
2023-01-06 15:41:48 +01:00
Tim Ledbetter
2f6c71c829 PixelPaint: Draw the lasso tool preview path with two colors
This stops the preview path disappearing when entering a dark area of
the image.
2023-01-06 15:41:48 +01:00
Andreas Kling
2a61d66b0a LibGfx: Make Font::preferred_line_height() more correct
Return a float, and fix a bogus calculation of ascender + descender.
2023-01-06 12:02:20 +01:00
Tim Ledbetter
fc5bcd8476 PixelPaint: Allow repeated zooming with the zoom tool
Previously, the zoom tool only allowed the user to zoom in or out
once, as it didn't take account of the current zoom level.
2023-01-06 00:34:38 +01:00
MacDue
a1726b1ba5 LibGfx: Avoid rounding/truncating glyph positions till blitting
This keeps some overloads that accept ints to avoid adding calls to
.to_type<float>() all over the place.
2023-01-05 12:09:35 +01:00
Andreas Kling
3407ab0fd1 LibGfx: Make Font::width() return a float 2023-01-03 15:25:02 +01:00
Baitinq
e89c649be1 PixelPaint: Propagate errors in {flip,crop,rotate,resize} functions
We now propagate errors when using the {Layer,Image}::flip(),
{Layer,Image}::crop(), {Layer,Image}::rotate() and
{Layer,Image}::resize() functions.

We handle these errors by show an error DialogBox with the error's
message.

This removes 8 FIXMEs:))
2023-01-03 09:58:02 +00:00