Commit Graph

105 Commits

Author SHA1 Message Date
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
David Capello 331688bd86 Add "Zoom with Scroll Wheel" option (on/true by default) 2014-06-22 22:35:51 -03:00
David Capello ec61c6b972 Add support for horizontal mouse wheel and scroll bar notifications (better support for trackpads)
WM_HSCROLL/WM_VSCROLL messages are used by some trackpads drivers to
notify about horizontal/vertical pan gestures.
2014-04-28 22:02:56 -03:00
David Capello 2c0642d1f1 It's better if mouse wheel doesn't center the scroll on zoom-in/out 2014-04-19 20:43:23 -03:00
David Capello 4c706afb90 New zoom tool 2014-04-19 20:08:21 -03:00
David Capello dd2ce20e25 Win32: Add support to convert mouse messages (WM_) to ui::Messages (using she::Events)
On Windows, instead of polling Allegro mouse position/buttons we can use
the mouse messages (WM_*) directly to generate she::Events. Those events
are received by the ui::Manager and converted to ui::Messages.
Maybe this is a possible fix for issue #133 (Wacom tablets don't work
properly).

Changes:
- Don't use jmouse_z() directly (new ui::MouseMessage::wheelDelta() member)
- Add ui::_internal_set_mouse_position() to change the jmouse_x/y(0)
  from the new mouse position received in she::Events. The same for
  ui::_internal_set_mouse_buttons().
- Modify the ui::Manager to generate mouse events in any case: using old
  Allegro 4 polling method, or from she::Events.
2014-04-17 22:23:12 -03:00
David Capello c558d664e8 Don't use C++11 enum class style yet 2014-02-24 08:31:02 -03:00
David Capello 43b2be4f0d Fix issue 347: Eyedropper tool changes in gui.xml (pick_fg ink) not working 2014-02-24 08:08:34 -03:00
David Capello e671508d85 Change infinite scroll implementation
Remove necessity of jmouse_x(1) and jmouse_y(1) calls.

- Renamed jmouse_control_infinite_scroll() -> ui::control_infinite_scroll()
- Renamed jmouse_set_position() -> ui::set_mouse_position()
- Added ui::get_delta_outside_box()
2014-02-02 18:46:19 -03:00
David Capello c8c099864c Added "Grab Alpha" option to eye dropper (issue 134) 2014-01-28 23:56:44 -03:00
David Capello fe552f60de Temporal fix for issue 299: Don't allow moving the selection from other editor than the current one 2013-12-29 19:53:28 -03:00
David Capello d6533d8a3f StandbyState::onUpdateStatusBar(): show frame duration 2013-12-22 12:28:07 -03:00
David Capello e5ba8e0922 Encapsulate Image implementation (private members, accessors, iterators, etc.)
- Rename _rgba/_graya to raster::rgba()/graya()
- Add raster::color_t type (alias for uint32_t)
- Rename raster::GfxObj to Object. And GfxObj::getType() to Object::type()
- Move conversion from raster::Image/Palette to Allegro BITMAP/RGB
  to raster/conversion_alleg.h file
- Add raster/color_scales.h
- Rename image_* functions to raster/primitives.h
- Reimplement ink processing with templates instead of macros
2013-11-09 19:59:05 -03:00
David Capello cde54f3682 Change BSD license to MIT in sublibraries and fix headers 2013-08-08 21:01:20 -03:00
David Capello c88f9b172b Refactor: Move app files to src/app subdirectory inside app namespace
- Add HAVE_CONFIG_H wrapper to #include "config.h"
- Removed widgets namespace (it's in app now)
- Move some functions from src/file/file.h to src/base/cfile.h
- Move Vector2d to base library
- Rename MenuItem2 to AppMenuItem
2013-08-05 21:20:19 -03:00