Commit Graph

192 Commits

Author SHA1 Message Date
David Capello 18ba8f184b Merge branch 'main' into beta 2022-03-02 21:31:31 -03:00
David Capello 31ce326d5b Fix ink tests when ENABLE_UI=0
It looks like we cannot trust in the get_current_palette() content
when we are running scripts without UI. So it's preferable if we get
the palette directly from the sprite.

We should completely remove the get_current_palette() function.

Tests can be found in https://github.com/aseprite/tests/blob/main/scripts/inks.lua
2022-03-02 21:27:06 -03:00
David Capello 74e9a73f48 Merge branch 'main' into beta 2021-08-13 14:49:18 -03:00
Martín Capello 1eb740482e Update last row and column of pixels in the editor's viewport when the sprite is zoomed in and the color mode or FX dialog are used. (also fix #2803) 2021-08-13 11:11:55 -03:00
David Capello d9e2f27e85 Avoid creating a copy of the tileset for the BrushPreview 2021-06-16 14:22:01 -03:00
David Capello 47c836fde1 Minor refactor: Move logic related to pixel perfect to IntertwineAsPixelPerfect 2021-06-16 12:54:29 -03:00
Martín Capello b980e386fa Fix pixel-perfect in manual tile mode (fix #2741) 2021-06-16 10:21:19 -03:00
Martín Capello d8b829a91f Fix the pixel perfect behavior when cel origin has negative x or/and y coordinates (#2748) 2021-06-04 10:23:20 -03:00
Martín Capello 687156a9ca Remove unnecessary copy() call. 2021-06-04 10:23:16 -03:00
Martín Capello d79c193e40 Fix dirty area calculation
Dirty area region was not calculated correctly when the bottom part of the modified area fell on the intersection of the top left and top middle tile sprites on a tiled-mode-enabled canvas and the top part fell outside of the canvas.
2021-05-28 15:46:50 -03:00
Martín Capello 3bce6f2272 Replace the ToolLoopImpl.wrapPositionOnTiledMode function by a new one in the TiledModeHelper component 2021-05-28 15:46:50 -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
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 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
David Capello a012dac020 Merge branch 'main' into beta 2021-04-12 17:11:28 -03:00
David Capello f311e3edde Fix selection feedback in indexed when mask color w/alpha=0 (fix #1412, fix #1667)
Also reported recently here (and probably in several other places):
https://community.aseprite.org/t/8462
2021-04-09 11:11:41 -03:00
David Capello dead710213 Fix regression showing the selection feedback above all layers
Without this fix we'll see the selection stroke feedback in the same
level as the active layer. With this patch the preview is displayed at
the top just as in the main branch.
2021-03-29 12:34:19 -03:00
Gaspar Capello a1e013f4a7 Fix rotSprite for normal layers (and keep the tile replication Ok on tilemap layers during a "transform action") 2021-01-30 11:18:40 -03:00
David Capello 289a6ab864 Merge branch 'master' into beta 2021-01-29 12:19:43 -03:00
Gaspar Capello 980454eac0 Fix brush symmetry
Prior to this fix, asymmetric brushes weren't reflected, instead the brush was simply moved to a mirrored position.
2021-01-15 12:15:16 -03:00
David Capello db80c2a07e Real-time preview when editing tilemaps in Manual mode
In this way we can see the changes to all instances of the same tile
in the tilemap in real-time. The preview is done through a new
"preview tileset" that is used in the render concept (instead of the
preview image, a preview tileset is used as a temporal tileset to be
used for preview purposes only).
2020-11-04 16:54:12 -03:00
David Capello 4d6f4434cd Remove unused flag ExpandCelCanvas::UseModifiedRegionAsUndoInfo 2020-11-03 20:47:13 -03:00
David Capello 40a56a6281 Fix expanded bounds when painting pixels (non-tiles) 2020-10-13 15:59:14 -03:00
David Capello 0bca1de5c1 Add support to fill with tiles 2020-10-09 17:22:57 -03:00
David Capello 0e84e8642e Fix Eraser tool (left/right click) in tiles mode 2020-10-06 10:40:08 -03:00
David Capello 90dd05d57c Update visible region when editor scroll/zoom change 2020-09-01 13:02:25 -03:00
David Capello c19ac7a45c Move the cancel flag from ToolLoop to ToolLoopManager 2020-09-01 12:13:24 -03:00
David Capello 5f45271779 Move some UI related things to ToolLoopBase() ctor to avoid querying the UI from the ToolLoopManager
There are plans to move the ToolLoopManager to a background thread, so
we cannot access the UI from that thread.
2020-09-01 10:28:21 -03:00
David Capello 4eeaad5a69 Fix preview with selection tools in tiles mode 2020-08-26 12:30:48 -03:00
David Capello 580fe1b030 Minor change in ToolLoopImpl getInk() -> m_ink 2020-08-25 16:08:59 -03:00
David Capello 5ee3ebdd71 Add fg/bg tiles selectors in ColorBar
Now fg/bg colors and fg/bg tiles are different widgets, and the
StatusBar can show tiles when the eyedropper is picking tiles.
2020-08-21 18:28:31 -03:00
David Capello e8dc717b08 Fix brush preview and drawing in tiles mode 2020-08-19 20:17:50 -03:00
David Capello 319eb3fd62 Use tilemap grid (instead of sprite grid)
Re-apply d862f9f94 which was deleted in 74c1f6af6 and it's needed when
we double-click tiles to select then.
2020-08-18 16:41:26 -03:00
David Capello 74c1f6af6b Rollback some changes to keep the Site::grid() origin in the cel position
Now ExpandCelCanvas uses a correctly modified doc::Grid that matches
the new and temporal cel position while we are drawing.
2020-08-06 20:26:08 -03:00
David Capello d862f9f948 Use tilemap grid (instead of sprite grid) w/selection tools in tile mode 2020-06-29 19:13:21 -03:00
David Capello 9420bfff18 Now selection tools select "by tiles" when we are in tile mode 2020-06-29 16:37:14 -03:00
David Capello d0c95cf46f Add possibility to paint with tiles 2020-06-25 19:21:35 -03:00
David Capello bd1723313a Merge branch 'master' into tilemap-editor 2020-06-12 11:33:55 -03:00
Gaspar Capello 9c37ea41ed Fix locked layer not completely locked (fix #2181) 2020-06-09 18:03:09 -03:00
David Capello a10efb187b Merge branch 'master' into tilemap-editor 2020-06-01 16:21:32 -03:00
David Capello 2bfd3261b5 Define fill_toolloop_params_from_tool_preferences() only when needed 2020-05-22 11:15:04 -03:00
David Capello b922cfcc10 Refactor ToolLoop creation w/ToolLoopParams to add more options to app.useTool()
This will be used to add more testing capabilities to app.useTool()
2020-05-19 20:11:47 -03:00
David Capello a80af2b304 Merge branch 'master' into tilemap-editor 2020-05-18 20:24:22 -03:00
David Capello d9b0887a3a Fix crashes running tests from CLI 2020-05-08 19:44:29 -03:00
David Capello 46f4002368 Fix crashes saving sprites with '%' char in their filename
To fix this we changed the way StatusBar text is handled (we are using
fmt::format() in StatusBar instead of printf-like ... args now).
2020-05-08 17:39:55 -03:00
David Capello a54e2ce13f Fix eraser tool/stylus tip when dynamics for gradients are on 2020-05-07 21:40:03 -03:00
David Capello c3ebf40cb1 Fix shading ink for RGB and Grayscale modes
The colors in the shades are not necessary to be in the palette or
related to a palette index in these modes (or even more, the color
palettes can be duplicated), the only important things are the values
in the shades for RGB and Grayscale, so in these modes now we access to
ToolLoop::getShade() directly and create a mini-palette to find the
colors there (ignoring the sprite palette completely).
2020-05-06 17:14:47 -03:00