Commit Graph

6129 Commits

Author SHA1 Message Date
David Capello
6c7f1ff05b lua: Add "bounds" parameter to Dialog:show() function 2019-07-12 16:44:54 -03:00
David Capello
568aadbfc8 lua: invalidate Dialog() after changing its bounds 2019-07-12 16:42:43 -03:00
Gaspar Capello
33dd70f89d Fix contour tool cannot draw only one pixel
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.
2019-07-12 14:41:48 -03:00
David Capello
04d547ce37 Use Tx instead of Transaction on PixelsMovement 2019-07-12 14:36:28 -03:00
David Capello
1ae29dfc3c Check if the context can show the new layer name dialog 2019-07-10 12:45:53 -03:00
David Capello
757fadeaf0 Add New Layer via Cut/Copy commands (fix #1567) 2019-07-02 15:28:05 -03:00
David Capello
fed9a2b45c Don't make layer indentation wider for child layers when we zoom in the timeline 2019-07-01 16:18:32 -03:00
David Capello
f2fae67734 Fix invisible brush edges in certain cases/zoom levels 2019-07-01 15:51:58 -03:00
David Capello
a0ebecca50 Make NewLayerCommand compilable when ENABLE_UI is not defined 2019-06-28 18:53:23 -03:00
David Capello
fe4106457f Add "Edit > Paste Special > Paste As New Sprite" option (fix #1024) 2019-06-28 18:51:14 -03:00
David Capello
e9d8392a46 lua: Several app.useTool() calls can be used in one transaction now (fix aseprite/api#18) 2019-06-28 16:44:52 -03:00
David Capello
ff6538a68e Add Edit > Paste Special > Paste As New (Reference) Layer (fix #672, fix #1748) 2019-06-27 15:34:56 -03:00
David Capello
056eb28670 Fix crash destroying temporal docs (e.g. adding new reference layer) 2019-06-25 15:53:31 -03:00
David Capello
86ffa37fdd Fix rendering bug with new engine and zoom out (canvas is not updated correctly) 2019-06-11 10:42:41 -03:00
David Capello
922505e8af Fix performance problem after viewing an huge sprite
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.
2019-06-10 17:43:38 -03:00
David Capello
8e193b592a Avoid refreshing the list of backup sessions when an item is doing some work/task 2019-06-10 11:02:03 -03:00
David Capello
07f64b7682 Fix Jumble tool brush behavior and improve IntertwineAsLines impl
* 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).
2019-06-08 13:35:30 -03:00
David Capello
8405add137 Fix error using an invalid crop_image() with Width < 1, Height < 1 when using New Brush with right-click outside the canvas bounds 2019-06-07 18:39:36 -03:00
Gaspar Capello
8281e49798 Fix joinStroke function from class IntertwineAsLines
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.
2019-06-07 17:28:03 -03:00
David Capello
45a09f1a15 Disable keepEditedSpriteData checkbox if dataRecovery is disabled 2019-06-07 15:12:39 -03:00
David Capello
fb05e91d01 Hide "Recover Files" button when it's disabled (fix crash clicking it in this case) 2019-06-07 14:40:11 -03:00
David Capello
2a364c3ad2 Fix saving general.keep_closed_sprite_on_memory_for preference with decimals 2019-06-07 13:27:31 -03:00
David Capello
ffee4e5407 Add a note about CLOSEDOC_TRACE that must be TRACEARGS if we want to debug it 2019-06-07 13:22:18 -03:00
David Capello
0554b53385 Rename TRACE() to RECO_TRACE() in data_recovery.cpp 2019-06-07 13:22:02 -03:00
David Capello
8201d62124 The assert can fail if we have the data recovery disabled 2019-06-07 13:18:23 -03:00
David Capello
c7d1e4a472 New option to configure how much time we keep a closed sprite on RAM 2019-06-07 13:17:21 -03:00
David Capello
a7a9d05de3 Fix compilation when ENABLE_UI is off 2019-06-06 14:58:45 -03:00
David Capello
7ce45c0017 Fix crash from backup observer thread because the condition variable is not yet initialized when the thread starts 2019-06-06 12:15:53 -03:00
David Capello
bf649df9f2 Add Wine version to user agent string in case that we're running Aseprite from Wine 2019-06-06 12:15:31 -03:00
David Capello
3cd6fa2f08 Add missing #include <vector> for doc::algorithm::createUnion() 2019-06-06 10:14:12 -03:00
Gaspar Capello
2366bee6d4 Fix createUnion function and added createUnion tests
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
2019-06-05 15:19:32 -03:00
David Capello
364b0d2088 Avoid resetting the showMenuBar setting to false by mistake
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.).
2019-06-05 10:44:00 -03:00
David Capello
07077c139d Don't print TRACE() output by default from gif_format.cpp 2019-06-05 10:30:18 -03:00
David Capello
013f10363f Destroy the main window at the very end
So we can check asserts on the Workspace about empty panels.
2019-06-05 10:21:18 -03:00
David Capello
ad64deef6c Several changes to default StatusBar text
* 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()
2019-06-05 10:16:34 -03:00
David Capello
706590df05 Fix eyedropper when zoom < 100%
Without this patch it was returning always the mask color (alpha=0%).
2019-06-04 16:48:04 -03:00
David Capello
7c26a88813 Avoid ASSERT() fail in ~DocObserverWidget()
We have to unselect all documents before we destroy the main window,
so all onActiveSiteChange()/onDocChange() are called correctly just in
case.
2019-06-04 16:47:29 -03:00
David Capello
29a6f89dc4 Minor change in src/CMakeLists.txt 2019-06-04 12:26:03 -03:00
David Capello
f789506428 Accept a valid case of FileOp() without preferences (for file_tests) 2019-06-04 12:25:02 -03:00
Gaspar Capello
81a355133d Add polygon tests 2019-06-04 12:14:20 -03:00
Gaspar Capello
8ae289d7e6 Fix createUnion internal function of polygon.cpp
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.
2019-06-04 12:13:33 -03:00
Gaspar Capello
62802cfbdf Fix outline preview of contour tool.
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.
2019-06-04 11:52:47 -03:00
David Capello
be74723e37 Destroy the data recovery before all documents
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.
2019-06-04 11:36:44 -03:00
David Capello
f430b9ce77 Avoid accessing Preferences from background thread when loading preset palettes 2019-06-04 10:58:19 -03:00
David Capello
79795b97a9 Fix hang if we press Cmd-S two or more times quickly to launch File > Save
With this we avoid to unintentional execute two or more times a
command when we are already in a command execution.
2019-06-03 23:02:24 -03:00
David Capello
2ab27ade9b Blur tool: Don't make more transparent pixels with alpha < 255
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.
2019-06-03 21:04:08 -03:00
David Capello
0e2fcffaa0 Add missing <condition_variable> header file to use std::condition_variable 2019-06-02 22:23:52 -03:00
David Capello
563c23117e Fix brush cursor bug with Gradient tool
https://community.aseprite.org/t/cursor-for-fill-tool-off-centre/3158
2019-06-01 11:04:48 -03:00
David Capello
fbbb3238a6 Save closed docs backup data when we close the application correctly
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
2019-05-31 19:59:43 -03:00
David Capello
f3731c9c28 Avoid making the color darker with Blur tool when alpha < 255 (fix #708)
Related to 065ad4f1dc
2019-05-31 18:36:09 -03:00
David Capello
8aaf679406 Add missing <algorithm> header to use std::sort() 2019-05-31 14:10:56 -03:00
Gaspar Capello
43b4c77be5 Minor fix, shape closing with Polygon Tool
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.
2019-05-31 13:34:06 -03:00
Gaspar Capello
8c55d34e32 Fix polygon rasterization
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.
2019-05-31 13:02:22 -03:00
David Capello
1ac3148f72 Don't show full path on Data Recover view if the user wants to hide them 2019-05-31 09:42:08 -03:00
David Capello
93fe19d353 Use cancelable async tasks to load/delete backup sessions 2019-05-30 23:17:13 -03:00
David Capello
91665c62c3 Fix bug showing invalid warning in Edit > Pref when "keep edited sprite data lifespan" wasn't modified 2019-05-27 23:53:57 -03:00
David Capello
bcf6899793 Update display immediately after and undo/redo command is executed from the native macOS menu (fix #2069)
Replaced ui::kFunctionMessage with os::Event::Callback.
2019-05-27 23:53:57 -03:00
David Capello
df741c246b Show "Loading..." item in DataRecoveryView if the list wasn't loaded before we click the "Recover Files..." option 2019-05-27 23:53:57 -03:00
David Capello
54883012bb Put "Reopen Closed File" and "Clear Recent Files" options inside "File > Open Recent" menu 2019-05-27 23:53:57 -03:00
David Capello
cdb98d4cd5 Add File > Reopen Closed File command 2019-05-27 23:53:57 -03:00
David Capello
1b62515cd2 Add "Recover Files..." option in Home tab
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)
2019-05-27 23:53:57 -03:00
David Capello
0902fa7629 Fix crash closing the program when the Data Recovery tab open 2019-05-27 23:53:57 -03:00
David Capello
a6041272c9 Minor assert() in Preferences::save() 2019-05-27 23:53:57 -03:00
David Capello
57d5fcba68 lua: Don't include -x64 in app.version 2019-05-27 23:53:57 -03:00
David Capello
f6313f7dc6 Restore the default brush center to w/2 and h/2
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.
2019-05-27 23:53:57 -03:00
David Capello
25cec1543c Fix "Repeat Last Export": params weren' filled with DocPref if ui=false
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).
2019-05-27 23:53:57 -03:00
David Capello
d6e00d8764 Fix IntertwineAsLines to use algo_line_perfect() again when snap to grid is enabled or kSquareAspect modifier is pressed 2019-05-27 23:53:57 -03:00
David Capello
232c551f1a Don't document preferences after loading it 2019-05-27 23:53:57 -03:00
David Capello
b0163f3937 Don't crash with div by zero when grid bounds has an invalid value 2019-05-27 23:53:57 -03:00
David Capello
54a1b1d67e Update zoom level in status bar correctly when we switch between sprites 2019-05-27 23:53:57 -03:00
David Capello
8e53b5f227 Fix contour tool (draw first pixel for contour tool) 2019-05-11 15:53:18 -03:00
David Capello
388af3f5e4 Fix symmetry for brushes with even size
This is a temporal fix, we should flip the brush center/image/etc.
2019-05-11 15:42:44 -03:00
David Capello
c07614cd5d Draw pixels that aren't in the viewport area when we use Shift+click to draw a straight line w/Pencil tool 2019-05-11 14:25:29 -03:00
David Capello
b058077b07 Fix BackupObserver for periods < 1 minute 2019-05-11 13:59:26 -03:00
David Capello
38abac8b79 Fix crash on Windows using Manager::enqueueMessage() from non-UI thread
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).
2019-05-11 13:53:31 -03:00
David Capello
2eba51a62d Fix minor warning 2019-05-11 13:42:50 -03:00
David Capello
85ce7eea6e Fix compilation error when ENABLE_UI is undefined 2019-05-08 19:18:19 -03:00
David Capello
bd18248be9 Fix compilation when ENABLE_SCRIPTING is defined 2019-05-08 15:53:55 -03:00
David Capello
262b8abc90 Temporal fix for filling polygons (at least with regular brushes) 2019-05-08 12:50:30 -03:00
David Capello
dd8a49a19c Add option to disable changing the display color profile depending on the current monitor 2019-05-08 10:55:56 -03:00
David Capello
dd405fa26d Eliminate warning about using a type from an anonymous namespace from another type from a non-anonymous namespace 2019-05-07 15:03:15 -03:00
Gaspar Capello
6afd31698f Fix center of eraser edges is wrong 2019-05-07 10:47:31 -03:00
David Capello
0c6e8de9e5 Double-click opens the slice properties dialog w/Slice tool 2019-05-07 10:33:05 -03:00
David Capello
e8716cbb6e Improve context bar for slice tool (combobox of slices + action buttons) 2019-05-07 10:28:37 -03:00
David Capello
48450ac79d Add info about TRACEARGS() in src/README.md 2019-05-06 14:15:44 -03:00
David Capello
5d7d01ac49 Update observable module 2019-05-06 14:15:25 -03:00
David Capello
398d1099fc Update submodules laf and observable 2019-05-03 10:23:14 -03:00
David Capello
74649cf87b Value stored but never read 2019-05-03 10:13:00 -03:00
David Capello
4004f7be65 Update to new gfx::Region API 2019-05-03 10:03:39 -03:00
David Capello
86d38d81b0 Avoid warning about missing "override" 2019-05-02 16:27:34 -03:00
David Capello
73de6c8b1d Add ability to edit multiple slices
Related to #721 and #1651, still need more work to give a better UX to
edit static and animated slices.
2019-05-02 16:26:13 -03:00
David Capello
40957c196f Minor refactor adding ToolLoop::onSliceRect() 2019-04-30 16:42:15 -03:00
David Capello
951fb7c357 Fix invalid scroll on ui::View after changing required size of attached widget (regressiong introduced in b4eb7a0ccd) 2019-04-30 13:51:41 -03:00
David Capello
eed5f98b75 Minor changes in ui::View 2019-04-30 09:54:01 -03:00
rscotchmer
a08cfa9e13 Added support for 4 and 8 connected pixel fill method in paint bucket 2019-04-29 23:29:17 -03:00
David Capello
39d229b0e9 Merge branch 'act-palette' of https://github.com/SupSuper/aseprite into master 2019-04-29 22:39:18 -03:00
David Capello
93a858b486 Improve Shift+mouse drag in Canvas Size
Change rulers in a symmetric way from the starting ruler positions
instead from the canvas.
2019-04-29 16:33:17 -03:00
David Capello
c7955337c2 Disable Shift+click to draw straight lines when we are in SelectBoxState 2019-04-29 15:50:34 -03:00
David Capello
934c3d45f7 Minor change in IntertwineAsLines::joinStrokes() 2019-04-29 15:34:46 -03:00
David Capello
430c7384e5 Remove the duplicate callback code for algo_line_continuous() 2019-04-29 15:28:21 -03:00
David Capello
e3dcb2b818 Minor changes in Intertwines (add "m_" prefix to member variables) 2019-04-29 15:22:22 -03:00
Gaspar Capello
8b7b62b2d4 Fix contour tool preview with image brush 2019-04-29 10:39:37 -03:00
Gaspar Capello
7bdff92846 Fix first point of line tool is not drawn 2019-04-29 10:39:37 -03:00
Gaspar Capello
c7dfff9b41 Fix straight line while drawing on pixel perfect 2019-04-29 10:39:37 -03:00
David Capello
74b0a70107 Simplify the handling of the filled case of the Contour tool 2019-04-29 10:39:02 -03:00
David Capello
9e0d732959 Reduce the case where we've to invalidate the whole dstImage 2019-04-29 10:39:02 -03:00
Gaspar Capello
b32db39aa2 Fix image brush paintbrush mode is broken (issue 1261) 2019-04-29 10:39:02 -03:00
David Capello
a77543eb2b Little improvements to brushes
- Better center (e.g. 2x2 brushes have the center in 0,0 instead of 1,1)
- Line brushes will always have a pixel in the center
2019-04-29 10:26:19 -03:00
David Capello
f97d76344d Fix useTool() with images: brushes must be created like when we use the UI, with a mask 2019-04-29 10:25:44 -03:00
David Capello
640800259d Add possibility to cancel brush creation with Esc key 2019-04-28 21:34:52 -03:00
David Capello
d0962eb737 Fix losing sprite center when we change zoom
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.
2019-04-28 21:27:05 -03:00
David Capello
b768d99743 Check that region to patch/copy on "cmd" is not empty to avoid useless cmds 2019-04-28 21:26:12 -03:00
David Capello
23f00d87f6 lua: Add error if we specify and invalid tool in app.useTool() 2019-04-25 16:33:49 -03:00
David Capello
b2df59563b lua: Add __eq function to Image metatable to compare image IDs 2019-04-25 16:32:36 -03:00
David Capello
0264964c4e lua: Add app.preferences object 2019-04-24 21:14:20 -03:00
David Capello
ad1a0af752 lua: Add a way to set/get the default app palette (and well-known palettes from resources) 2019-04-24 19:08:25 -03:00
David Capello
5cf762c9cf lua: Fix app.useTool() tests when we run in batch/non-UI mode
* 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
2019-04-24 18:31:43 -03:00
David Capello
e8a057a334 Don't generate cmd::CropCel() if it isn't necessary 2019-04-24 17:31:06 -03:00
Gaspar Capello
6f72666330 Restore brush pattern correctly from user preferences 2019-04-24 16:12:01 -03:00
David Capello
a2d9f3fc76 Fix crash changing states from Undo History window when we've removed layers 2019-04-24 10:17:12 -03:00
David Capello
e197a8670c Add an option to trim areas outside the canvas bounds on Sprite > Canvas Size (fix #1111) 2019-04-23 14:40:26 -03:00
David Capello
bbba80c809 Modify Canvas Size to be more "tool like" (easier to change the edges size, C keyboard shortcut) 2019-04-22 15:57:45 -03:00
David Capello
af0b700a6d Fix typo in comment 2019-04-22 09:05:33 -03:00
David Capello
589bfe2cbf lua: Minor refactor of Version class 2019-04-22 09:04:07 -03:00
David Capello
d35251d431 lua: Add Version() class 2019-04-21 00:04:49 -03:00
David Capello
20618ff321 Ignore errors about signed/unsigned comparison 2019-04-18 22:35:29 -03:00
David Capello
8a821c83fd lua: Add Brush class and app.useTool{ brush } parameter 2019-04-18 22:33:48 -03:00
David Capello
0bf5d1de30 lua: Add functions to load/save palettes and images directly 2019-04-17 23:59:59 -03:00
David Capello
d24fc0a93a lua: Add Sprite:flatten() 2019-04-17 15:00:51 -03:00
David Capello
17895dce69 Support MergeDownLayer when ENABLE_UI is not defined 2019-04-17 00:16:52 -03:00
David Capello
dba3f3cdfb Minor improvement in ChangePixelFormat dialog
Moved the progress bar in other at the left of the OK button and the
progress bar appears only if we have to report a progress value > 0
2019-04-17 00:07:33 -03:00
David Capello
9746a30564 Convert place field of outline command into a ButtonSet 2019-04-16 18:12:07 -03:00
David Capello
266352cfec Use fgColor by default on Outline filter always 2019-04-16 17:55:31 -03:00
David Capello
8551fbda26 Add possibility to select any matrix to run the OutlineFilter 2019-04-16 17:54:42 -03:00
David Capello
be74710067 Fix flicker issues on Windows moving the BrushPreview 2019-04-16 14:22:42 -03:00
David Capello
58e27376bd Fix OutlineFilter::tiledMode() setter 2019-04-16 12:17:08 -03:00
David Capello
97d54f04c0 Fix warning 2019-04-15 09:26:00 -03:00
David Capello
69a303b126 Add warning when we open new .aseprite files with tilemaps on old versions 2019-04-15 09:25:38 -03:00
David Capello
11c8ba3605 Fix merging down linked layers (https://community.aseprite.org/t/2894) 2019-04-13 17:19:29 -03:00
David Capello
ebca165b2a Add support to modify activeFrame/Layer from scripts without UI 2019-04-13 16:25:21 -03:00
David Capello
8d359dd896 lua: Fix app.activeSprite setter 2019-04-13 11:17:17 -03:00
David Capello
62f6b24b5b lua: Add Sprite(sprite) to duplicate sprites easily 2019-04-13 11:16:58 -03:00
David Capello
b2e169569a Merge branch 'spritesheet-fullpath' of https://github.com/kawa-yoiko/aseprite into master 2019-04-12 16:07:54 -03:00
David Capello
43d6867f98 Remove ASSERT() that can fail in Graphics::doUIStringAlgorithm() 2019-04-12 16:03:24 -03:00
David Capello
7f21deb4d5 Fix showing keyboard shortcuts on AniControls tooltips 2019-04-12 13:49:35 -03:00
David Capello
61d1e7c46c Add Horizontal and Vertical outline options in OutlineCommand 2019-04-11 23:21:14 -03:00
David Capello
84b44a36ea Improve ui::Theme::drawSlices() performance using os::Surface::drawSurfaceNine() 2019-04-11 22:54:47 -03:00
David Capello
f5000f7414 Fix invalid memory access on cli_tests
AppOptions must live as long as CliProcessor.
2019-04-11 15:38:03 -03:00
David Capello
e3f09525db Refactor the thumbnails generation of cels
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.)
2019-04-11 14:29:20 -03:00
David Capello
59361a3b6d Minor changes about how aspect ratio is presented on the status bar 2019-04-10 13:51:15 -03:00
David Capello
6ec178aece Fix call to render::get_sprite_pixel() which needs the clip size with the zoom applied 2019-04-09 16:49:28 -03:00
David Capello
c99ca3093d Minor changes in BackgroundFromLayer::onExecute() comments 2019-04-05 13:21:47 -03:00
David Capello
c690747bd2 Improve color conversion preview without clearing the old image
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).
2019-04-03 21:19:44 -03:00
David Capello
109e6fa205 Add render::Dithering() class to store all dithering parameters 2019-04-03 19:32:24 -03:00
David Capello
fcf272bb69 Add amount parameter to Error Diffusion algorithm 2019-04-03 18:45:18 -03:00
David Capello
e1437a20c3 Fix Floyd-Steinberg error propagation for the 1/16 part
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
2019-04-03 15:02:23 -03:00
David Capello
08ec3767ba Add support to scan the image in zig-zag way for error diffusion filters 2019-04-03 12:14:17 -03:00
David Capello
02aa8f2205 Fix using UI widgets from background thread on ChangePixelFormat + merge layers checkbox 2019-04-03 11:34:36 -03:00
David Capello
495058e8ff Save last used dithering algorithm converting RGB -> Indexed 2019-04-03 11:05:54 -03:00
David Capello
b6d07d995f Fix error diffusion algorithm
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.
2019-04-02 13:58:55 -03:00
David Capello
c2af88343e Fix invalid memory access in ErrorDiffusionDither 2019-04-02 00:18:36 -03:00
David Capello
20b8ee0e57 Add Floyd-Steinberg dithering for RGBA -> Indexed conversion 2019-04-01 22:00:32 -03:00
David Capello
c0b4224f32 Fix sprite position after undoing/redoing a move/copy timeline range operation 2019-04-01 20:35:50 -03:00
David Capello
f3bb1ecdf1 Fix regression introduced in ed0f4c3023 2019-04-01 19:57:53 -03:00
Gaspar Capello
855c7d8ee3 Improved import sprite sheet dialog (from #1987) 2019-04-01 16:51:19 -03:00
David Capello
29a4c6f744 Fix accessing to invalid Site object after undoing/redoing
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.
2019-04-01 15:50:59 -03:00
David Capello
ed0f4c3023 Don't access Preferences to do color conversion from bg threads
Continuation of 673e1955fa
2019-04-01 15:44:49 -03:00
David Capello
c6fb34ef4a Don't access newBlend preference from background threads
Continuation of 673e1955fa
2019-04-01 15:29:48 -03:00
David Capello
9c98f9c4df Don't use Preferences to get default slice color in background thread
Continuation of 673e1955fa
2019-04-01 15:01:16 -03:00
David Capello
bbd96a23b5 Add some comments for the #1964 fix 2019-04-01 14:31:27 -03:00
Gaspar Capello
22b58aafaa Don't copy the export file name to sprite preferences created from Save As or Export (fix #1964) 2019-04-01 14:16:52 -03:00
David Capello
42d5f10437 Fix access to memory out of scope on Sprite Properties when assigning/converting color profiles
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.
2019-04-01 14:11:42 -03:00
David Capello
98a660a06b Fix rendering of active sprite when color management is disabled 2019-04-01 14:11:06 -03:00
David Capello
55f58d8bea Don't convert thumbnail color profile to sRGB when color management is disabled 2019-04-01 14:10:38 -03:00
David Capello
673e1955fa Don't use Preferences in background threads 2019-04-01 13:19:42 -03:00
David Capello
686da0efd8 Merge branch 'rect-pack-padding' of https://github.com/kawa-yoiko/aseprite into master 2019-04-01 10:18:58 -03:00
David Capello
b22903b326 Refactor Cel::createCopy/Link() -> Cel::MakeCopy/Link() receiving the new frame position for the copy/link 2019-03-29 18:04:54 -03:00
David Capello
07cc284c30 lua: Add Image:isEmpty() and Image:isPlain() 2019-03-29 15:55:10 -03:00
David Capello
c945996fd6 lua: Add tostring support for Point/Size/Rectangle 2019-03-29 15:54:20 -03:00
David Capello
047dbbca67 Update clip module 2019-03-28 22:57:31 -03:00
David Capello
325d675786 Fix thumbnails for indexed images with transparent color (GIF files mainly) 2019-03-28 10:44:06 -03:00
David Capello
d9aa0d5c68 Convert thumbnails to sRGB color space + don't use EditorRender from thumbnails workers 2019-03-28 10:28:34 -03:00
Shiqing
14c1bceb4c Add padding support for --sheet-pack 2019-03-28 13:22:47 +08:00
David Capello
30798435d1 Fix an edge case where m_remainingItems has elements but we don't have more workers to consume it 2019-03-26 15:19:52 -03:00
David Capello
dbae196f2d Fix using Enter key to open folder a when we've the focus in the filename entry 2019-03-26 14:22:48 -03:00
David Capello
8ba0ea4519 Simplify the stop process of thumbnail generators 2019-03-26 10:59:11 -03:00
David Capello
ce27188852 Fix FileList items size in list mode when the vertical scroll bar is hidden 2019-03-26 09:25:58 -03:00
David Capello
5acadc69ca Avoid locking the UI when we enter in a new folder
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.
2019-03-26 08:20:24 -03:00
David Capello
9e7e2767c8 Fix several issues decoding TGA files 2019-03-25 23:48:21 -03:00
David Capello
9a75d01efe Improve the File Selector adding new view types: list, small icons, big icons (fix #451) 2019-03-25 22:09:22 -03:00
David Capello
01fb806091 Update doc library copyright year 2019-03-25 08:53:17 -03:00
David Capello
d18001559b Fix bug locking mutex to access doc objects list and newId counter 2019-03-25 08:22:12 -03:00
David Capello
2812a95f1e lua: Add params to app.useTool() to change the cel where we'll draw 2019-03-23 16:34:51 -03:00
David Capello
1f7f5415cd lua: Add Color.rgbaPixel and .grayPixel 2019-03-23 16:34:15 -03:00
David Capello
98080544cf lua: Rename app.toolStroke() -> app.useTool()
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.
2019-03-23 13:31:14 -03:00
David Capello
7d8e493dca Fix crash undoing Edit > Shift (regression from 1c05ea10bb) 2019-03-23 11:44:38 -03:00
David Capello
fd9ff17976 Merge branch 'macos-menubar' of https://github.com/kawa-yoiko/aseprite into kawa-yoiko-macos-menubar 2019-03-23 09:48:56 -03:00
David Capello
396824383f lua: Add app.activeTool + Tool object 2019-03-23 09:19:10 -03:00
Shiqing
5d5aae7311 Fix incorrect layout with --trim and --sheet-pack 2019-03-23 16:06:00 +08:00
David Capello
54f95dda77 Fix gradient origin when the kFromCenter is not used (regression introduced in 250d40c0f3)
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.
2019-03-22 18:22:30 -03:00
David Capello
3c35887abf Specialize Params::get_as<bool>() to read "true" as a true bool
Just like new params impl Param<bool>::fromString()
2019-03-22 11:47:45 -03:00
David Capello
674f9ff3b5 Get AutocropSprite strings from i18n file
After introducing AutocropSpriteCommand::onGetFriendlyName(), we stop
using the automatic commands_AutocropSprite string from en.ini. This
commit fix that regression from f24eb75298
2019-03-22 11:27:39 -03:00
David Capello
60e8a5967d Minor changes to f24eb75298 2019-03-22 11:26:44 -03:00
David N Campo
f24eb75298 Add --trim-by-grid CLI option 2019-03-22 10:55:26 -03:00
Shiqing
223002c182 Disable app menu during laf modal dialogs on macOS 2019-03-22 13:40:31 +08:00
Shiqing
ca1728fd38 Fix #1606 sprite sheet contains full path of image 2019-03-22 12:42:07 +08:00
David Capello
8062c81018 Remove unused variable 2019-03-21 17:07:59 -03:00
David Capello
9461e609e2 Add dimension and color in theme.xml to customize palette view separators 2019-03-21 16:58:50 -03:00
Shiqing
e9d7fd2a06 Fix app menu may become disabled on macOS 2019-03-21 20:14:57 +08:00
David Capello
4919740861 Add option to disable the separator between palette entries 2019-03-20 14:27:19 -03:00
David Capello
3ec3f75d91 Add radial gradient
Related to:
* https://steamcommunity.com/app/431730/discussions/1/3182216552785250054/
* https://community.aseprite.org/t/radial-gradient/2711
* part of #1629
2019-03-19 20:54:25 -03:00
David Capello
250d40c0f3 Fix gradients from center and/or outside sprite canvas 2019-03-19 20:40:23 -03:00
David Capello
da695c0a98 Keep old recent files so we'll be able to run old versions and new without losing recent files/paths 2019-03-19 10:06:13 -03:00
David Capello
104b68555e Fix crash using UIContext::getAllEditorsIncludingPreview() on ToolLoopBase::limitDirtyAreaToViewport() when a two points controller is used on app.toolStroke() on batch mode 2019-03-18 22:32:50 -03:00
David Capello
33c6fc5f40 lua: Fix tools tests when ENABLE_UI is not defined 2019-03-18 13:30:17 -03:00
David Capello
7aec117b5e Fix segfault on CLI mode because activeInk() tries to access to the color bar 2019-03-16 13:46:09 -03:00
David Capello
25189224b9 lua: Rename app.drawWithTool() -> app.toolStroke() 2019-03-16 13:15:06 -03:00
David Capello
1cb5949e9b lua: Add app.drawWithTool() function 2019-03-15 17:03:02 -03:00
David Capello
79601567c5 Remove assert that can fail in batch mode 2019-03-15 16:26:10 -03:00
David Capello
d872a0b422 Fix issue where filter preview sometimes doesn't start 2019-03-11 20:18:37 -03:00
David Capello
9cf408541f Add Edit > FXs > Outline command (fix #371, #1198) 2019-03-11 15:35:22 -03:00
David Capello
db348ea3b5 Fix problem adding new error lines in FileOp when \n are not used correctly 2019-03-11 12:01:52 -03:00
David Capello
be067452de Change ReplaceColorFilter color fields from int to color_t 2019-03-11 12:01:28 -03:00
David Capello
e4117d05c5 Minor changes in style/formatting 2019-03-11 11:48:13 -03:00
David Capello
41707c103d Remove unused field from GetPixelsDelegate in convolution filter 2019-03-11 11:43:22 -03:00
David Capello
2527b90544 Remove unused field from ConvolutionMatrixFilter 2019-03-11 11:42:35 -03:00
David Capello
b7b2d4651d Render: Avoid drawing the background image if it's not needed 2019-03-09 15:00:09 -03:00
David Capello
996d385040 Render::renderBg/SpriteLayers() are functions used only inside Render 2019-03-09 12:53:36 -03:00
David Capello
db21a17fba Add DST_OVER blend mode for grayscale color mode 2019-03-09 12:47:23 -03:00
David Capello
2f426e3b2f Fix render_tests with indexed images 2019-03-09 12:46:05 -03:00
Gaspar Capello
f53544842c Fix non-normal blend modes when the backdrop is transparent (fix #1096) 2019-03-09 12:40:31 -03:00
David Capello
cc62e9ed59 Add render_benchmark 2019-03-07 13:44:29 -03:00
David Capello
4035952238 Do not check sRGB profile when reading/saving png files
Fixes https://community.aseprite.org/t/2656
2019-02-22 11:04:27 -03:00
David Capello
f3265656f2 Replace the ellipse algorithm completely to fix infinite-loops w/huge ellipse sizes
Probably this bug was introduced in 8549774060
2019-02-21 08:26:42 -03:00
David Capello
6a1a21726e Show modified regions correctly in ToolLoop on visible areas in non-active editors
Regression introduced in 6a88713213
2019-02-21 08:20:00 -03:00
David Capello
7af4365588 Improve cmd::CopyRegion() performance
Here we replace std::stringstream with a base::buffer (std::vector<uint8_t>)
and pre-allocating the required size.
2019-02-20 18:47:38 -03:00
David Capello
6a88713213 Avoid validating hidden areas while we're in the tool loop for tools like line/square/ellipse, etc. 2019-02-20 17:29:20 -03:00
David Capello
b4eb7a0ccd Add support to continue drawing while we're scrolling
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.
2019-02-20 15:57:20 -03:00
David Capello
45837af1fc Minor rename of doLoopStep() argument 2019-02-20 11:17:43 -03:00
David Capello
e960a79a87 Move dirty area from ToolLoop impl to ToolLoopManager 2019-02-20 11:17:09 -03:00
David Capello
3e7bfbb296 Redraw all editors (mainly the preview) after flashing the layer 2019-02-18 14:10:01 -03:00
David Capello
53ace57e81 Change layer flashing implementation (#1997)
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).
2019-02-18 11:47:35 -03:00
David Capello
89bf12a60a Fix arrow keys to move the selection content
Regression introduced in 1c05ea10bb
2019-02-15 17:33:48 -03:00
David Capello
798d0e9a08 lua: Add functions to modify the selection (Sprite.selection and Selection.origin) 2019-02-15 17:19:23 -03:00
David Capello
7594ebf25b Generate selection boundaries automatically after transactions
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
2019-02-15 17:14:44 -03:00
David Capello
668b29193a Remove unused Project-related classes 2019-02-15 15:49:36 -03:00
Gaspar Capello
1c05ea10bb Fix shift after flip throws error (fix #1873) 2019-02-15 11:18:14 -03:00
Gaspar Capello
5cb0adc46a Fix tga creates Background layer on Load (task #1997) 2019-02-13 16:19:33 -03:00
David Capello
e0e83f0d40 Add Dialog:file() (#1997, fix aseprite/api#7) 2019-02-13 16:15:04 -03:00
Gaspar Capello
b3eba1c952 Fix unnecessary warning saving TGA (fix #1830) 2019-02-12 19:03:07 -03:00