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
Tim Ledbetter
4be6ee85e0
PixelPaint: Ensure layers are positioned correctly when painting
...
Previously, layer bitmaps could move slightly relative to their
boundary and the image background when panning and zooming.
2023-02-01 19:36:39 +01:00
Tim Ledbetter
607c8045dc
PixelPaint: Allow dragging when color picking using the Alt key
2023-02-01 19:21:58 +01:00
Tim Ledbetter
06e09cf415
PixelPaint: Disable current tool when color picking using the Alt key
2023-02-01 19:21:58 +01:00
Tim Ledbetter
2f5bbc68ed
PixelPaint: Use eyedropper cursor when color picking using Alt key
2023-02-01 19:21:58 +01:00
Tim Ledbetter
45e60a416b
PixelPaint: Use layer coordinates when color picking using Alt key
...
Previously, raw coordinates were being used, which meant that color
was being sampled from the wrong position.
2023-02-01 19:21:58 +01:00
Tim Schumacher
8464da1439
AK: Move Stream
and SeekableStream
from LibCore
...
`Stream` will be qualified as `AK::Stream` until we remove the
`Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is
defined by `SeekableStream`, since defining its own would require us to
qualify it with `AK::SeekMode` everywhere.
2023-01-29 19:16:44 -07:00
MacDue
a75f9273b4
PixelPaint: Increase default window height by 10px
...
This stops the clone and gradient tools from being cut off the side
bar.
2023-01-29 13:38:27 +01:00
Linus Groh
108ea2b921
LibCore: Remove try_
prefix from fallible SharedCircularQueue methods
2023-01-28 22:41:36 +01:00
Linus Groh
65fa7db2b5
PixelPaint: Remove try_
prefix from fallible ProjectLoader methods
2023-01-28 22:41:36 +01:00
Linus Groh
86f28ceace
PixelPaint: Remove try_
prefix from fallible IconBag methods
2023-01-28 22:41:36 +01:00
Linus Groh
8a884b2581
PixelPaint: Remove try_
prefix from fallible Image methods
2023-01-28 22:41:36 +01:00
Linus Groh
39f1a6eb6f
PixelPaint: Remove try_
prefix from fallible Image methods
2023-01-28 22:41:36 +01:00
Sam Atkins
65d03e3b9d
PixelPaint: Remove declarations for non-existent methods
2023-01-27 20:33:18 +00: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
MacDue
efb2bed525
PixelPaint: Fix off-by-one in on_second_paint() clip rect
...
Previously the clip rect did not include the 1px border at the edges
of the rulers.
2023-01-27 18:05:19 +00:00
Sam Atkins
c36de98223
PixelPaint: Replace uses of JsonObject::get_deprecated()/get_ptr()
2023-01-27 08:07:24 -05: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
4bad4dc8d5
PixelPaint: Use background color when cropping layer to content
...
This commit expands the functionality of the "Crop Image to Content"
and "Crop Layer to Content" features by allowing them to detect and
crop the background color of an image instead of just cropping
transparent pixels.
The background color is determined by looking at the corner pixels of
the image. If no background color is found, the old behavior of
cropping transparent pixels is retained.
2023-01-25 14:31:15 +01:00
Sam Atkins
1dd6b7f5b7
AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()
...
This is a preparatory step to making `get()` return `ErrorOr`.
2023-01-17 19:52:52 -05:00
Tim Ledbetter
3fb4d50982
PixelPaint: Preserve layer location when copying layers
...
Location metadata is now included when copying a layer to the
clipboard. This allows a pasted layer to be placed in the location it
was copied from.
2023-01-17 00:36:01 +01: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
Liav A
e241b47fee
Userland: Remove a bunch of unveil calls on /sys/kernel/processes
...
These are not needed anymore since the introduction of the new
get_root_session_id syscall.
2023-01-13 13:41:30 +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
Sam Atkins
a8cf0c9371
LibCore+Userland: Make Core::Timer::create_single_shot() return ErrorOr
...
clang-format sure has some interesting opinions about where to put a
method call that comes after a lambda. :thonk:
2023-01-12 11:25:51 +01:00
Sam Atkins
a15d44f019
LibCore+Userland: Make Core::Timer::create_repeating() return ErrorOr
...
The FIXMEs must flow!
2023-01-12 11:25:51 +01:00
Sam Atkins
f0395a2042
LibGUI+Userland: Rename try_load_from_gml()
-> load_from_gml()
:^)
...
It's the only one, so the `try` prefix is unnecessary now.
2023-01-07 14:39:30 +01:00
Sam Atkins
54b1326165
Userland: Replace all uses of load_from_gml
with try_load_from_gml
...
MOAR FIXMES! ;^)
2023-01-07 14:39:30 +01:00
Karol Kosek
301f9de915
PixelPaint: Port to Core::Stream
:^)
2023-01-07 10:53:43 +00:00
Karol Kosek
247db3fdd0
LibFileSystemAccessClient: Rename try_* functions to try_*_deprecated
...
These functions return the deprecated `Core::File` class, so let's mark
it as such to avoid possible confusion between future non try_*
functions which will use Core::Stream family classes and to possibly
grab someone's attention. :^)
2023-01-07 10:53:43 +00:00
Sam Atkins
0c24522635
LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)
...
Rip that bandaid off!
This does the following, in one big, awkward jump:
- Replace all uses of `set_main_widget<Foo>()` with the `try` version.
- Remove `set_main_widget<Foo>()`.
- Rename the `try` version to just be `set_main_widget` because it's now
the only one.
The majority of places that call `set_main_widget<Foo>()` are inside
constructors, so this unfortunately gives us a big batch of new
`release_value_but_fixme_should_propagate_errors()` calls.
2023-01-06 13:36:02 -07: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
bd65ecf05c
PixelPaint: Cleanup the Image class
...
This patch just introduces some general cleanup regarding unused
imports and adding the const qualifier to eligible functions and
variables.
2023-01-03 09:58:02 +00:00