The purpose of this fix is enable drawing of one pixel with contour
tool is active and we drag the cursor inside of the same
pixel (https://community.aseprite.org/t/3509).
Added 3 tests in polygon_tests.cpp to test polygon function when the
expected results is a simple pixel.
When we were viewing an huge sprite, a temporal buffer (os::Surface*)
used to render it would increase its size to the size of the
canvas. After that, whatever other sprite that we saw (even for the
smallest one) we were unnecessary clearing the entire (huge) internal
buffer with os::Surface::clear() on each render.
This problem was visible only using the new render engine.
* Fixed Jumble tool behavior: When brush is circular, all the brush
bounds (square) where randomized. And at the end all the pixels were
re-randomized.
* Solved the double-point in IntertwineAsLines from
62802cfbdf in an alternative way: Just
don't draw the first point when we join consecutive 2 points
strokes (the issue here is that freehand controller generates
strokes of two points, so every call on joinStroke() of
IntertwineAsLines has only two points, we have to check if we're
drawing the first stroke, and if we are drawing the second 2 points
stroke, we skip the first pixel to avoid drawing it two times,
solved with IntertwineAsLines::m_firstStroke).
The purpose of this fix is draw correctly the
first stroke point as result of a joinStroke() execution
from class IntertwineAsLines when following
conditions are meet:
- pencil tool
- pixel perfect OFF,
- custom brush
- try to draw a line of 2 pixel.
The original issue was detected by the tests functions
based in useTool function on Lua scripts.
The issue was presented in tool.lua.
The purpose of this fix is that createUnion handles situations
which union results in contiguous segment collapses.
Added some treatments of eventual illogical inputs arguments like:
- pairs.size() < ints
- ints is 1
- ints is a odd number
Fixed treatment of some union cases like:
- x == pairs[i+1] + 1
- x == pairs[i+1]
Simplification of some vector::insert execution.
Added a bool return type to know if the function was
successfully executed when is called (used in tests).
We change the “static void createUnion(…)” to
“bool algorithm::createUnion(…)” to conditioning it to
future tests.
Added some comments modifications.
Added tests to polygon_tests.cpp
Change the way we calculate the first-execution of the
program (without depending on the UUID of the updater, e.g. because
the server didn't return an UUID, etc.).
* Change the Home status bar text
* Show the full path of the document (if the user preferences allow
us) when we move the mouse over the document tab
* We weren't calling onWorkspaceViewSelected() from
WorkspacePanel::setActiveView()
Added special treatment in cases of horizontal lines which input
argument to createUnion is “ints == 0”. Conditionals were sorted, it
was being generate extra scan segment pair next to pair in analysis,
instead of an augmentation of it.
The purpose of this fix is to correct the outline preview of the
Contour Tool when:
- is used with custom brush,
- with alpha content,
- and pixel perfect mode OFF.
Before this fix, the outline was being printed more than twice in some
places (only noticed with alpha content), giving a bad appearance.
We have to join the BackupObserver thread before we delete all docs,
if not we could use a deleted doc when deleting/joining the backup
observer thread.
Regression introduced in f3731c9c28 (which
fixed 065ad4f1dc). I think this is the
final version of the blur tool: doesn't make pixels more darker nor
transparent.
Also some extra improvements like:
* Wake up every X seconds/minutes to check if we have to save some
backup data (instead of each one second)
* Use a condition variable to wakeup when we quit the application
The purpose of this fix is to match polygon preview with the polygon
result when using Polygon Tool (before this fix, we were been see few
pixels differences on the shape closing segment). To achieve this, the
way how we draw the entire joinStroke has to match how polygon
function interpolate the final stroke which closes the shape. So, the
input vertices of doPointshapeLine function were swapped.
This fix is intended to create a polygon that matches with its preview
in one drawing step (needed when we want to draw with Contour or
Polygon tool with custom brushes with alpha content). Before this fix,
the polygon was being created in a first step, and then a second step
that patches the contour (over writing the Image with an extra
joinStroke execution of the entire contour).
- Added createUnion function in polygon.cpp to force drawing of the
input points in each scan line render.
- Added algo_line_continuous inside polygon function to interpolate
holes between input vertices.
- Deleted extra joinStroke execution in fillStroke function in class
IntertwineAsLines and class IntertwineAsPixelPerfect inside
intertwines.h
- Added Stroke::erase function to Stroke class. It is needed inside
IntertwineAsPixelPerfect class to get a clear m_pts (without the
extra points due to mini L shapes, due to pixel perfect process). In
fillStroke function in class IntertwineAsPixelPerfect inside
intertwiners.h, when it executed, m_pts is delivered to polygon
function instead of stroke argument in order to pass a pixel perfect
processed vector instead of stroke vector which is a raw vector of
vertices.
We've changed the way the "recover files" option works:
* Now it's an option that is always available (so we can open files
even from sessions that were correctly closed in the past)
* We can open sessions from other Aseprite versions (as in a "best
effort" approach, if it works, ok, if it doesn't -> contact user
support)
This generated a lot of controversy. The new center ((w-1)/2
, (h-1)/2) was useful for scripts, but not too useful for right-handed
users that prefer the most bigger part of even-sized brushes to be in
the top-left edge (instead of bottom-right edge which was the new
behavior).
With this patch we revert the changes, and we'll see if we can add a
new option to change the default brush center which might be useful
for left-handed users.
The "Repeat Last Export" command needs to copy DocPref to params, even
when the UI not used (also we must copy the DocPref to the params only
if sprite sheet type is not defined, which means that a script didn't
specify it).
From time to time the app::BackupObserver::backgroundThread() will use
ui::execute_from_ui_thread() to show/hide the backup notification icon
in the StatusBar (see SwitchBackupIcon class). This
ui::execute_from_ui_thread() function enqueues a ui::FunctionMessage
calling the Manager::enqueueMessage(). The issue here is that
enqueueMessage() uses ui::is_ui_thread() to check if the thread that
wants to enqueue the message is the UI thread or other thread, and
depending on this decission the message will be directly added to
msg_queue or enqueued into concurrent_msg_queue.
The issue was that ui::is_ui_thread() was not working correctly on
Windows because GetCurrentThread() is not useful to check the current
thread with a previous call of GetCurrentThread() from other
thread (the function always return the same value, a special generic
value that identifies the current thread whatever it is).
This issue is pretty common when we change the zoom and the cursor is
outside the canvas, we lost the center of the sprite or the canvas
goes more far and far away. I've seen this problem on streamers and
myself using the program. Hoping to do a little of improvement in this
area with this patch.
* Tools must use the default configuration when we run in -batch mode
* Fixed app_get_current_pixel_format() when ENABLE_UI is disabled so
the color= parameter of app.useTool{} depends on the activeSprite
color mode
A new Render::renderCel() method is used to render the specific cel
thumbnail, useful in the future to render thumbnails of different kind
of layers (e.g. future tilemaps). And now the background is rendered
in a different step (so the thumbnails doesn't contain the
background.)
It is better for continuous preview feedback to keep the old image so
the new preview result is painted above the old one (and there is no
flicker effects).
This patch fixes the quantization of a complete gray
image (RGB=128,128,128), which must generate a black and white
checkered pattern when the Floyd-Steinberg filter is applied.
Regression from b6d07d995f
The error propagation must be limited to 0...255 values, and the new
quantization error must be calculated to that limited value. Also the
1/16 part of the Floyd-Steinberg distribution must be the remaining of
the other parts.
Mainly the site.layer() field of the context writer after an undo/redo
is not valid anymore (e.g. because the layer could have been removed).
Now we get the new active site (Context::activeSite()) to go to that
place after the undo/redo operation.
Some buttons where calling the updateButtons() lambda that were
defined inside a sub-scope of SpritePropertiesCommand::onExecute()
(which is where the window is displayed
ui::Window::openWindowInForeground()), the lambda was already
out-of-scope when it was used by other lambdas.
Instead of calling ThumbnailGenerator::generateThumbnail() for each
visible item on FileList::onPaint(), we create another queue of items
to be generated on each monitoring tick.
This function was called app.drawWithTool() first, but some tools do
not "draw" (e.g. eraser, selection-like tools, etc.). And then the
app.toolStroke() name could be confused with the Edit > Stroke
command.
When the kFromCenter is enabled, we have to use the middle-point of
the two points controller as the origin of the floodfill algorithm,
but when kFromCenter is not enabled, we use the first point. This is
the only way to make both cases work well in such a way that the
origin of the floodfill is not displaced when the mouse is moved.
After introducing AutocropSpriteCommand::onGetFriendlyName(), we stop
using the automatic commands_AutocropSprite string from en.ini. This
commit fix that regression from f24eb75298
This change also avoids three scroll events when we zoom in/out, so
there are no two extra scroll events with invalid mouse position <->
editor position conversions.
This avoids locking the UI for some seconds and should fix the
flashing layer impl for macOS (and maybe other platforms where the
display is not updated immediately).
Now Transaction::commit() will regenerate mask boundaries
automatically if in the middle of the transaction the document
selection was modified. This is the first step to finally remove
update_screen_for_document() and any kind of manual screen
refresh.
This will be useful for scripting functions that modify the selection
too, because we wouldn't need to regenerate the selection boundaries
automatically from the script or from app.refresh() Lua function.
Related to #378