Commit Graph

7752 Commits

Author SHA1 Message Date
David Capello
2bc64cf5ff Add PalettePicks::invert() member function 2021-05-20 17:57:22 -03:00
David Capello
de8b6ff2b4 Add support to select used/unused tiles from multiple tilemap layers using the same tileset
With this commit we've also simplified the
SelectPaletteColorsCommand::selectTiles() function.
2021-05-20 17:49:16 -03:00
David Capello
405c1cfd39 Remove the " Menu" suffix from the palette menu 2021-05-20 17:38:57 -03:00
David Capello
bc824ed9e6 Fix crash calling PaletteSize without active sprite 2021-05-20 17:31:08 -03:00
David Capello
56ae29a9b4 Add different names to SelectPaletteColors and possibility to assign keyboard shortcuts to these items
Now we can assign keyboard shortcuts to the whole Palette menu.
2021-05-20 17:28:32 -03:00
David Capello
4b2947a81c Refactor SelectPaletteColorsCommand and enable it always for colors and in tilemap layers for tiles
The command doesn't depend on the current TilemapMode.
2021-05-20 16:26:21 -03:00
Gaspar Capello
3c6320a4b5 Add select used colors and select used tiles on palette options 2021-05-20 15:59:42 -03:00
David Capello
b3e80c49a1 Merge branch 'editor-functions-refactor' into beta 2021-05-20 15:50:37 -03:00
Martín Capello
6c08b5807d Fix straight line preview on pencil tool to avoid crash 2021-05-20 15:47:55 -03:00
David Capello
89fcd44394 Select the initial ColorButton color when we go back to the button
If start dragging from the ColorButton, we go outside the button, and
then we go back to the same button, we should select the original
color when the whole drag-and-drop process started.

We have also improved the look of the button in that case: the
original color is displayed (instead of the inverted color, which is
when the button is selected, in this way is less confusing).
2021-05-20 15:42:09 -03:00
Gaspar Capello
b26d3dc7b6 Minor fix in primitives.cpp 2021-05-20 10:53:26 -03:00
Martín Capello
ab58deaa45 Refactor Editor's methods to move their code into another component
By moving the code of these methods we enable automated testing of some functionality that depends of the functionality but not depends of the Editor's GUI.
2021-05-19 17:33:04 -03:00
Martín Capello
34250a145f Fix wrapPositionOnTiledMode to avoid having any edge of the point shape area outside of the canvas.
When some of the edges of the point shape area is outside of the canvas the collapseRegionByTiledMode doesn't include the rects that were outside of the canvas.
2021-05-19 17:27:01 -03:00
David Capello
8b6aa2945f Fix issue restoring sprite user data color from data recovery sessions 2021-05-18 15:22:28 -03:00
David Capello
fe1d96ed0e Fix alternating through random colors when picking from the same ColorButton 2021-05-18 14:58:29 -03:00
David Capello
414165f078 Add support to resize sprites with tilemaps
This fixes Sprite > Sprite Size and File > Export when a resize
parameter != 100% is given.
2021-05-18 14:52:53 -03:00
David Capello
dd9ef64668 Hot region is specified in screen coordinates for PopupWindows 2021-05-15 14:37:11 -03:00
David Capello
54c286407b Close several PopupWindows at the same time w/one click
Clicking outside a popup window we can close several popup
windows (e.g. tool box tooltip + tool box group popup, or brush pop +
brush params popup).

Before this change a kMouseDownMessage in a PopupWindow will close the
window only if the Manager::getTopWindow() was equal to the PopupWindow.
2021-05-15 14:33:29 -03:00
David Capello
e4e8bfb246 Fix BrushPopup bug disappearing when mouse moves to other brush type
There were an old bug where the brush popup changed its behavior after
opening a BrushSlotParams menu popup i.e. after that the BrushPopup
disappeared just leaving the mouse outside its hot region (but before
that it disappeared clicking outside the BrushPopup).

Anyway with this change the BrushPopup will disappear only clicking
outside the popup in all cases.
2021-05-15 13:56:34 -03:00
David Capello
d1dcbcbad0 Show more zoom options in Keyboard Shortcut dialog 2021-05-13 11:07:39 -03:00
David Capello
8e61313f0e Add shortcut for Sprite > Sprite Size 2021-05-13 11:07:25 -03:00
David Capello
8e9dcd76ad Add "New..." submenu to layer menu popup in the timeline 2021-05-11 19:12:19 -03:00
David Capello
694ec4a86c Merge branch 'main' into beta 2021-05-11 18:59:24 -03:00
Gaspar Capello
b1203216be Fix crash when remap on palettes with more than 256 colors 2021-05-11 18:57:55 -03:00
David Capello
6f7e86f892 Fix bug not-redrawing the selected palette after double-clicking other one in the PalettePopup
In the PalettePopup if the current sprite palette matches one palette,
that palette in the list has a tick, that tick must be updated if we
choose other palette from the list.
2021-05-11 16:31:13 -03:00
Martín Capello
8cee671b71 Update IntertwineAsPixelPerfect to avoid redrawing all the strokes on each tool loop. 2021-05-11 15:33:06 -03:00
David Capello
216a5af0f5 Fix preview in ChangePixelFormatCommand 2021-05-10 18:41:37 -03:00
David Capello
5ef84eb873 Fix regression introduced in OctreeMap when pixelCount() was converted to size_t 2021-05-10 18:06:00 -03:00
David Capello
0059739a24 Handle windows Z order of the ui::Manager regardless of whether multiple windows are on/off
In this way we keep the internal Z order of windows correctly in both
cases to deliver mouse messages.
2021-05-10 16:14:23 -03:00
David Capello
05b89eb83b Fix some OS X issues moving windows 2021-05-10 16:14:03 -03:00
Gaspar Capello
26faab7cb6 Add "Space+1/2/3" shortcuts to tile mode button tooltips 2021-05-10 11:55:28 -03:00
David Capello
d2c6abf5a7 Fix saving/loading correct frame position (mainly on macOS)
We have to save the frame position before we close the native
window.
2021-05-10 11:52:38 -03:00
David Capello
69a7faefa2 New default RgbMapAlgorithm to select what could works better at a given time 2021-05-09 20:53:09 -03:00
David Capello
1779e11f5e Use expandWindow() to expand/collapse some windows that were left behind in the refactor 2021-05-09 20:45:57 -03:00
David Capello
3b785133ea Add comment about possible future configuration for findBestfit2() 2021-05-09 17:41:11 -03:00
David Capello
712b948a29 Some minor refactors in octree code
* Moved static member functions of OctreeNode to .cpp file (and to
  private access because they are using only inside OctreeNode)
* Defined OctreeNodes type (alias for std::vector<OctreeNode*>)
* Changed m_pixelCount to size_t
* Added const modifier to some member functions
* Merged normalizeColor()+LeafColorToColor() -> rgbaColor()
* Refactor children() -> hasChildren() (because the function is only
  used to check if there are children in the node)
* Some initial values to member variables to remove constructors
  directly
* getModifications() -> modifications()
2021-05-09 17:36:17 -03:00
David Capello
8a22fe220c Use configured algorithm to convert RGB -> Indexed by default 2021-05-09 12:58:27 -03:00
David Capello
4c1a13bf07 More info about coding style 2021-05-04 18:32:38 -03:00
David Capello
19d7566249 Fix bug where F5 was resetting the color bar box size/zoom 2021-04-30 11:31:02 -03:00
David Capello
9c5b856aef Fix crash copying floating tilemaps 2021-04-30 10:47:57 -03:00
David Capello
d6acb9e20f Save/load main window layout correctly and limit to current workarea
* Now the restored frame position/maximized flag are saved correctly.
* We've improved the default size to the current workarea of the main
  screen.
* Limit the initial frame position to the current available screens
  (e.g. the saved frame position could be invalid if the user
  unplugged a monitor)
2021-04-29 16:13:45 -03:00
David Capello
0934a78db6 Add some comments in fit_bounds.cpp 2021-04-29 16:08:25 -03:00
David Capello
3eb8411ecc Fix bug removing used tiles with Auto mode in some special cases 2021-04-28 17:18:28 -03:00
David Capello
588a6dc63c Fix destruction order of native windows to avoid crashing
We've to send kCloseMessage first, and then destroy the native
window (so children native window are destroyed correctly when
kCloseMessage is received, e.g. ComboBox popup must destroy its native
window when it receives a kCloseMessage of the parent window).
2021-04-23 15:35:27 -03:00
David Capello
69c1bb1d99 Update laf module (don't give wintab32.dll a chance to overwrite our exception handler) 2021-04-23 15:34:28 -03:00
David Capello
8569cf449a Fix magic wand tool used in a transparent layer when cel origin=(0,0) 2021-04-22 15:46:07 -03:00
David Capello
ecbd845aae Merge branch 'main' into beta 2021-04-22 14:02:36 -03:00
David Capello
d7a1c71df0 lua: Add support for selection tools in app.useTool()
Fix https://github.com/aseprite/api/issues/37
2021-04-22 13:51:56 -03:00
Gaspar Capello
4d9d1f309c Fix regression: line tool draws extra pixels on the canvas edge
How the bug could be reproduced (before this fix):
- Select the line tool.
- Click and hold down the left mouse button on the canvas to put the first line point.
- Drag the mouse outside the canvas and move it around (like trying to put the second point of the line outside the canvas).
2021-04-22 10:47:24 -03:00
David Capello
63ec1f2ae8 Fix compilation error in clang 2021-04-22 09:57:18 -03:00