Commit Graph

164 Commits

Author SHA1 Message Date
David Capello 5c3f75c64b Merge branch 'master' into beta 2016-11-07 18:17:42 -03:00
David Capello 1b2b98ec38 Fix bug which we can get stuck on MovingCelState (fix #1315) 2016-11-07 17:16:40 -03:00
David Capello 35c9bd3194 Move check that a ref layer cannot be transformed to StandbyState::transformSelection() 2016-11-07 10:30:40 -03:00
David Capello 609946c33f Support resizing a reference cel with Move tool 2016-10-25 19:15:36 -03:00
David Capello 6ce73a831a Don't allow draw/modify reference layers 2016-10-17 13:49:28 -03:00
David Capello 1b053de2f2 Fix eyedropper/move tool for reference layers 2016-10-13 19:58:42 -03:00
David Capello e46d453356 Merge branch 'master' into beta 2016-09-23 13:21:51 -03:00
David Capello d4c4cb5f72 Fix graphical glitches while painting (fix #1262) 2016-09-22 20:16:14 -03:00
David Capello 1404b0ce7d Merge branch 'master' into beta 2016-09-16 16:02:26 -03:00
David Capello a30b7c5217 Fix cursor flickering using simple crosshair with 400% scaling 2016-09-14 14:12:24 -03:00
David Capello 20b726f73b Merge branch 'master' into beta 2016-08-31 19:53:52 -03:00
David Capello 5ecc356a41 Replace GPL license with the new EULA 2016-08-29 13:08:21 -03:00
David Capello 36bfa1d641 Merge branch 'beta' into layer-folder 2016-07-28 23:02:24 -03:00
David Capello 9c73841970 Move gfx::Transformation to app::Transformation
In this way gfx library doesn't depend on fixmath.
2016-07-11 15:40:27 -03:00
David Capello ac20d1edfc Fix some commands/editor states to check parent group editable/visible state too 2016-06-15 15:27:38 -03:00
David Capello 389ea666e5 Fix crash trying to paint in a group layer 2016-06-08 15:01:02 -03:00
David Capello 5d8af3ca36 Trim (or remove) cels automatically (when they are completely empty) (fix #559, fix #1111) 2016-05-04 12:32:39 -03:00
David Capello 640025e84b Fix selection UX to show white/black negative for the stroke
With this patch now we can use the selection tool in locked or hidden
layers, because the selection doesn't modify the layers (only the
selection). Also we can use the selection tool on any layer and we'll
always see the feedback stroke/shape/rectangle while we're creating
the new selection.
2016-05-02 18:42:02 -03:00
David Capello fc0cebc0dd Redraw editor only when selection handles must be redrawn 2016-04-25 15:26:46 -03:00
David Capello a09b00dba8 Fix synchronization of different UI elements depending on the active tool
With this patch now the context bar shows the real active tool
preferences. For example, if we choose the option to use the Eraser
tool with right-click, now right-clicking will draw with the Eraser
brush size (instead of using the selected tool/left-click tool brush
size).

Changes:
* Removed the toolBox.activeTool() field from preferences
  (as the option isn't persisted between sessions)
* Added an observable app::tools::ActiveToolManager class to sync all
  UI elements that depend on the active tool and ink.
* Moved a lot of "active tool" logic from app::Editor to the
  new ActiveToolManager
* Moved app::tools::ToolLoopManager::Pointer as an indepedent
  app::tools::Pointer class
2016-04-25 15:20:53 -03:00
David Capello 5f90ef7c9b Add properties in App to access directly to timeline/contextBar/workspace 2016-04-22 13:19:06 -03:00
David Capello 33003fb6f9 Show current grid tile in status bar when the grid is visible (fix #1075) 2016-04-19 15:51:34 -03:00
David Capello 065188aea3 Include <cstring> needed in standby_state.cpp 2016-04-19 14:24:27 -03:00
David Capello 87ef48b50b Improve status bar with icons/automatically generated and re-used parts (fix #752) 2016-04-19 13:45:23 -03:00
David Capello 2ce09c53dd Add customization for square aspect, draw from center, and move origin keys (fix #1028)
Some changes:
- Now ui::Keys aren't processed in app::tools side, they are processed
  in Editor side and converted to ToolLoopModifiers flags.
- Replace ToolLoop::getSelectionMode -> ToolLoop::getModifiers()
2016-04-04 18:46:48 -03:00
David Capello 417e431a32 Add different selection modes to SelectTile command
Now we can add a tile using Shift+double click or substract one with
Shift+Alt+double click.
2016-03-19 12:09:03 -03:00
David Capello e62f80842c Avoid enter to tool loop after we select the tile 2016-03-19 12:04:39 -03:00
David Capello 30f4e995a3 Select a tile by double clicking over it (fix #939) 2016-03-19 11:33:05 -03:00
David Capello ef4a4822da Call onEnterState() from base class in SelectBoxState and StandbyState 2016-02-18 11:40:11 -03:00
David Capello c49ec61fa0 Minor refactor: rename DocumentView::getEditor/Document() -> editor/document() 2016-02-13 01:33:43 -03:00
David Capello 6e6ee10872 Merge branch 'snapSymmetryHandlesToViewportEdge' of https://github.com/TheKK/aseprite into TheKK-snapSymmetryHandlesToViewportEdge 2015-12-08 15:27:17 -03:00
David Capello 562106c6f0 Add EditorDecorator::getInvalidDecoratoredRegion() needed in #873 2015-12-07 15:25:10 -03:00
Ying Ruei Liang (KK) 2537b76cda Now the handles snap to the edge of viewport 2015-12-06 21:56:53 +08:00
David Capello e944ce0052 Move Bind, Connection, Signal, Slot, etc. to base namespace 2015-12-04 15:17:42 -03:00
David Capello 1aaeacc460 Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.

Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
2015-12-04 14:39:04 -03:00
Ying Ruei Liang (KK) 7e09f79285 Show preview correctly when moving multiple cels
Now you can see all the selected cels move synchronously while you drag
them with moving tool.
2015-12-04 01:05:28 +08:00
David Capello a3deb2063e Add MovingSymmetryState to modify symmetry axis position 2015-10-28 20:00:18 -03:00
David Capello 74e642d997 Add extra KeyContexts for each selection transformation 2015-09-11 20:04:02 -03:00
David Capello 0645a66521 Fix pressing multiple KeyAction modifiers at the same time (fix #778) 2015-08-25 13:29:19 -03:00
David Capello 1bee62ce8a Call eyedropper with right-click only when we have the mouse capture (fix #706) 2015-08-19 18:05:03 -03:00
David Capello 9966b48139 Add support to drag the selection in other editor when the active one is in MovingPixels state 2015-08-14 13:06:26 -03:00
David Capello 75a743f141 Separate pivot visibility and location options 2015-08-14 10:09:15 -03:00
David Capello 462f1f395e Add support to rotate the selection/moving pixels (fix #161) 2015-08-13 21:47:30 -03:00
David Capello 7cfdf76b0e Add rotation pivot options in context bar (fix #370)
With these options we can configure to show the pivot and the default
location when we select a sprite area.
2015-07-29 16:35:34 -03:00
David Capello 35229e99a6 Add opaque/transparent mode in context bar for transformations (fix #546)
With this change now we add a "mask" image/parameter in rotation
functions. In this way we can identify which specific pixels are
inside the original mask/selection, and in opaque mode we can
include/scale/rotate all those pixels inside the mask, whatever
value they are, even if they are the mask color.

Fixes #730
2015-07-23 22:42:14 -03:00
David Capello be6779631b Modify eyedropper tool to pick colors with alpha and support several modes
Issue #286
2015-07-02 18:13:47 -03:00
David Capello 710e640174 Fix preview of transformations (PixelsMovement) 2015-06-25 14:54:06 -03:00
David Capello f571e4ceb2 Add BrushPreview class to wrap all code related to brush preview/editor cursor 2015-06-25 12:44:47 -03:00
David Capello 3c60136631 Move PI constant to base/pi.h file 2015-06-16 15:04:00 -03:00
David Capello f9b76e0f3e Fix crash destroying PixelsMovement's extra cel from Editor::clearBrushPreview()
If Ctrl key isn't mapped to Move tool (or any tool without brush preview),
when we use Ctrl+V to paste clipboard content, the extra cel created
by PixelsMovement will be destroyed by Editor::clearBrushPreview()
when the Editor state changes.

This bug only happened when the brush preview was visible and Ctrl+V was
used. Also it could happen if we mapped any other key (e.g. "A") to
paste the clipboard content directly when we were using a drawing tool
(like the Pencil tool).
2015-06-08 12:13:55 -03:00
David Capello f6be0c3be6 Replace ISettings with Preferences
Changes:
* Move FreehandAlgorithm/InkType/RotationAlgorithm/SelectionMode to
  app::tools namespace
* Removed ISettings, IToolSettings, IBrushSettings, ISelectionSettings,
  and IColorSwatchesStore (and implementations from UISettingsImpl)
* Added app::tools::PreferenceGlue to do some adjustments that
  UIToolSettingsImpl was doing
* Remove signals from App related to brush size/angle changes, and current
  tool change (there events can be observed directly from Preferences)
* Remove ColorBar::FgColor/BgColor, these options can be observed from
  Preferences::colorBar.fg/bgColor
2015-05-18 16:53:25 -03:00
David Capello 00ff89529c Replace ISettings::get/setGrabAlpha() with Preferences class 2015-05-13 11:46:49 -03:00
David Capello cd1f764d85 Rename EditorState::onBefore/AfterChangeState to onLeave/EnterState()
This is to avoid confusion about the meaning of these callbacks.
2015-05-10 19:32:42 -03:00
David Capello 20120f432a Fix crash trying to move an empty cel with Move tool 2015-04-30 17:26:46 -03:00
David Capello ceb469339d Draw transformation handles only in active editor (fix #82, fix #632) 2015-04-27 10:08:48 -03:00
David Capello 21c4fd51d9 Move app::DocumentLocation to doc::Site
This is a first step to include the current selected range of layers
and frames inside the doc::Site structure. So in the future we'll not need
to know about the Timeline in commands that handle those ranges.
2015-04-20 16:27:09 -03:00
David Capello 849e40b0f9 Fix crash when PixelsMovement() wants to create an extra cel without enough memory 2015-04-15 13:59:41 -03:00
David Capello 294ff0e4f6 Rename src/app/util/misc.[cpp/h] -> new_image_from_mask.[cpp/h] 2015-04-02 09:55:18 -03:00
David Capello 0cb4b2234d Always load params when a command is executed
This is to avoid leaving commands with old params (a problem with
keyboard shortcuts). To make sure, we've changed arguments from Params*
to Params&, so we always have params to load.

Also, in this change we introduce a new way to give parameters to executed
commands from menu items using AppMenuItem::setContextParams(). Before
showing a popup, we can call setContextParams() to give extra params to
the command (e.g. the specific FrameTag to remove or change properties).
In this way "contextparams" attribute for <item> in gui.xml is not
available anymore.
2015-03-11 15:40:22 -03:00
David Capello b23194dfae Fix several warnings in MSVC, clang, and gcc 2015-03-05 15:19:00 -03:00
David Capello e85c63aa93 Merge branch '1.0'
Conflicts:
	src/app/ui/editor/editor.cpp
	src/app/ui/editor/moving_pixels_state.h
	src/app/ui/editor/pixels_movement.cpp
	src/app/ui/editor/pixels_movement.h
	src/app/ui/editor/standby_state.cpp
	src/app/ui/editor/tool_loop_impl.cpp
	src/app/util/expand_cel_canvas.cpp
	src/app/util/expand_cel_canvas.h
2015-02-15 18:12:03 -03:00
David Capello 02ad6b9b78 Fix several bugs dropping pixels in the invalid editor 2015-02-15 17:08:21 -03:00
David Capello 2c6067f7e4 Update license of app/ module to GPLv2 2015-02-12 12:16:25 -03:00
David Capello 22f35ab249 Independent scroll/zoom in Preview window (part of issue #407) 2015-02-10 12:59:43 -03:00
David Capello 06636fd16e Merge branch '1.0'
Conflicts:
	src/app/file/gif_format.cpp
	src/app/file/gif_options.h
	src/app/ui/editor/moving_cel_state.cpp
	src/app/ui/editor/standby_state.cpp
	src/app/util/range_utils.cpp
2015-01-29 12:18:13 -03:00
David Capello 2a582638ec Fix crash trying to move pixels and the current layer is nullptr
This fix was found thanks to a user provided memory dump. We don't know
why the layer can be nullptr, but there are some conditions preventing
this situation already in other places of the StandbyState::onMouseDown()
member function.
2015-01-28 11:04:07 -03:00
David Capello 06d18f1e8a Replace doc::FrameNumber with doc::frame_t 2014-12-28 20:39:11 -03:00
David Capello da1358c5dc Unify all render code in one library
Changes:
* Create render library (move util/render.cpp to render/render.cpp)
* Move app::Zoom class to render::Zoom
* Remove doc::Image::merge() member function
* Add gfx::Clip helper class (to clip dst/src rectangles before a blit)
* Move doc::composite_image() to render::composite_image()
* Remove doc::Sprite::render()
* Replace Sprite::getPixel() with render::get_sprite_pixel()
* Remove doc::layer_render() function
* Convert DitheringMethod to a enum class
* Add AppRender to configure a render::Render with the app configuration
* Move checked background preferences as document-specific configuration
* Add doc::Sprite::layer() and palette() member functions
* Add doc::Layer::cel() member function
* Add doc::Palette::entry() member function()
* Add doc::frame_t type
* Move create_palette_from_rgb/convert_pixel_format to render library
* ExportSpriteSheet doesn't need a temporary image now that we can specify
  the source rectangle in the render routine
2014-12-28 11:06:11 -03:00
David Capello afbd3b2d96 Optimize ToolLoop with modified regions of pixels
Here we avoid copying and clearing pixels that will not be used
in the whole tool loop process.
Changes:
* Add several member functions in ToolLoop to validate/invalidate regions
  of source/destination images so we know what regions are safe to use
  by inks and can be shown in the editor
* Add new DocumentObserver::onExposeSpritePixels() member to validate
  pixels that will be displayed in the editor
* Add Ink::needs/createSpecialSourceArea() member functions to validate
  extra areas for inks like blur or jumble
* Add undoers::ModifiedRegion to save the undo information about the
  modified region
* Add ShowHideDrawingCursor class
* Change "blur" tool policy from overlap to accumulate

(This is a real fix for issue #239)
2014-12-08 14:57:56 -03:00
David Capello 5aea29348e Merge branch '1.0'
Conflicts:
	data/gui.xml
	src/app/CMakeLists.txt
	src/app/color_utils.cpp
	src/app/color_utils.h
	src/app/commands/cmd_preview.cpp
	src/app/document_exporter.cpp
	src/app/document_exporter.h
	src/app/ui/editor/standby_state.cpp
	src/config.h
	src/main/resources_win32.rc
2014-12-03 11:15:09 -03:00
David Capello a8af9df74a Remove unused variable 2014-11-30 20:54:46 -03:00
David Capello aee7eb7bd4 Fix issue #548 - Avoid moving hidden layers or auto-selecting them 2014-11-30 09:43:33 -03:00
David Capello 752faf11f2 Remove jmouse_[xyz]() functions 2014-11-25 22:10:28 -03:00
David Capello d9ed3c2348 Rename jmouse_[gs]et_cursor() to ui::[gs]et_mouse_cursor() 2014-11-25 21:30:56 -03:00
David Capello f1cd3bbbe2 Merge branch '1.0'
Conflicts:
	src/app/ui/editor/standby_state.cpp
	src/app/ui/editor/tool_loop_impl.cpp
2014-11-24 21:53:10 -03:00
David Capello 82cc87d9be Redraw transformation handles when the quick tool is changed 2014-11-24 21:15:59 -03:00
David Capello 4fc28d5639 Add zoom out (related to issue #33)
Before the zoom was handle as a bits shift (scaled = value << zoom),
now the zoom is a fraction (scaled = value * zoom.num / zoom.den).

Changes:
* Add Zoom class to apply/remove zoom factor
* Split merge_zoomed_image template function into
  merge_zoomed_image_scale_down and merge_zoomed_image_scale_up
  to handle the special case where zoom.num/zoom.den < 1.0
2014-11-24 17:18:30 -03:00
David Capello 80501899ca Change errors UI related to locked/hidden layers to status bar tips
This was mainly done for Ctrl+click, so when we try to move the
Background layer, we avoid an annoying message box.
2014-11-24 11:50:02 -03:00
David Capello 17b0bee0ae Refactor: Use gfx::Point in several places instead of two x,y integers
Changes:
* Add doc::Sprite::bounds()
* Use gfx::Point to store the doc::Cel position
* Replace "int x, int y" with a "const gfx::Point&" param
* Fix Mask::intersect(const gfx::Rect&) and Mask::crop(const Image*)
2014-11-24 00:09:22 -03:00
David Capello cc889f2b2f Minor refactor to doc::Layer flags 2014-11-16 23:03:30 -03:00
David Capello acfe155b24 Merge branch '1.0'
Conflicts:
	src/app/color_picker.cpp
	src/raster/sprite.h
2014-11-16 18:59:30 -03:00
David Capello c64ee5729b Add "Auto Select Layer" check box to Move Tool (close #527) 2014-11-16 18:33:31 -03:00
David Capello c0078809f7 Merge branch '1.0'
Conflicts:
	data/gui.xml
	src/config.h
	src/main/resources_win32.rc
2014-11-16 13:26:02 -03:00
David Capello 3ba3b48fd7 Fix crash using eyedropper above a (hidden) selection handle
We need to be in a Selection ink to start moving pixels from transform
handles.
2014-11-13 11:23:45 -03:00
David Capello 7615c22827 Merge branch '1.0'
Conflicts:
	src/app/color_utils.cpp
	src/app/tools/ink_processing.h
2014-11-02 22:38:14 -03:00
David Capello 9fb3396392 Fix problems with multiple editors in MovingPixelsState (fix #419) 2014-11-02 16:15:52 -03:00
David Capello 63995c6f0a Merge "raster" namespace into "doc" library 2014-10-20 22:21:31 -03:00
David Capello e133c341ff Add fixmath library 2014-09-21 11:51:24 -03:00
David Capello 64a841a1d6 Remove unused variables 2014-09-09 08:49:52 -03:00
David Capello 0b3ec08987 Fix crash trying to move the selection from a empty cel 2014-08-24 19:37:24 -03:00
David Capello 9a15126682 Fix issue 188: Pick foreground color with right mouse button 2014-08-19 08:17:57 -03:00
David Capello 5075c1f86f Remove unused variables/code 2014-08-17 20:37:12 -03:00
David Capello dfc1ecd2da Use #pragma warning only in MSC compiler 2014-08-14 23:38:06 -03:00
David Capello 6db36fe30b Add ZoomCommand so zoom keys are configured in gui.xml file 2014-08-13 00:22:29 -03:00
David Capello 1c324c9b14 Add experimental option to use native mouse cursors (and some renames of cursor names) 2014-08-10 19:51:14 -03:00
David Capello 1e84c63042 Use ui::Window to show the animation playback instead of a custom event loop 2014-08-09 17:14:56 -03:00
David Capello 7632e83046 Don't show selection handles in the MiniEditor 2014-08-09 12:24:04 -03:00
David Capello 626ec1d2ba Add MoveTaskCommand: now you can move the selection with Shift+arrow keys 2014-08-08 01:00:02 -03:00
David Capello 91b0c2d071 Refactor: Remove "get" part for member functions that act like a simple getter
Additional change:
- Added Cel::image() to get the related image of the cel directly
2014-07-30 01:28:15 -03:00
David Capello 0b8d88d6ee Add "slice" ink and tool (it is not yet implemented) 2014-06-27 22:58:38 -03:00