Commit Graph

6942 Commits

Author SHA1 Message Date
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
759326f1b6 Move GitHub ISSUE_TEMPLATE file inside the .github directory 2019-06-05 10:22:40 -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