Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
Replace Result<T, E> with ErrorOr<T> and propagate the error to callers.
|
|
Another one that was used in a fajillion places.
|
|
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
This resolves #10641.
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
|
|
Previously when restoring the starting snapshot in the UndoStack we
would end up with no layer selected, which was kinda annoying
|
|
|
|
|
|
Add icons for three more layer actions.
|
|
|
|
13e526de43847ac86d74e3cb0be2d6b930f1d46f added the feature to new Layer
dialog. This patch adds it to Image dialog to stay consistent across
the app. :^)
|
|
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.
|
|
|
|
If you enter a custom aspect ratio, and are not holding down shift,
the rectangle will be constrained to the entered aspect ratio
|
|
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
|
|
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`.`
|
|
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.
|
|
There's no use for these two to be larger than necessary when
resizing the window.
|
|
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()
|
|
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.
|
|
Shift-key modifier for tools forces square aspect ratio.
It allows drawing squares with Rectangle Tool and circles
with Ellipse Tool.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|