Commit Graph

3286 Commits

Author SHA1 Message Date
David Capello
57156bddb7 Remove unused param 2015-04-29 15:00:17 -03:00
David Capello
edbff42dc8 We can delete brushes right-clicking them and selecting "Delete" 2015-04-29 15:00:05 -03:00
David Capello
1b25c4e9e9 Add slots in the ContextBar to select brushes with Alt+1, Alt+2, etc.
Now the ContextBar contains a set of brushes. The ChangeBrushCommand
supports a new "slot" parameter and "change" = "custom" to select a
specific custom brush from the ContextBar. Alt+1, Alt+2, etc. are mapped
to this ChangeBrushCommand (see changes in gui.xml).

Also, as the ButtonSet that represent different brushes in the ContextBar
uses icons generated from the brush, we don't need the skin parts that
represent each brush type (we can generate those icons from some standard
brushes). Those skin parts were removed.
2015-04-29 12:32:44 -03:00
David Capello
b08b226aef Move active brush information to ContextBar 2015-04-28 18:21:33 -03:00
David Capello
303bd120dc Keep one instance of BrushPopup in memory 2015-04-28 12:53:02 -03:00
David Capello
058682bcaa Avoid creating consecutive SelectBoxStates with Ctrl+B
If we press several times Ctrl+B, we could create several SelectBoxStates,
and as it backs to the previous state, it's like we will select several
brushes instead of backing to the original state.
2015-04-28 12:46:50 -03:00
David Capello
f09db4d9aa Add new BrushPopup (now the image brush is previewed)
This is the first step to create a bigger BrushPopup to select brushes
from an history of brushes. The general idea is to use Alt+1, Alt+2, etc.
to select different brushes from a stock.

Also the "discard brush" was removed. As the brush can be discarded
changing the brush type.
2015-04-28 12:38:15 -03:00
David Capello
274b903aad We can cancel the selection of the brush using the other mouse button 2015-04-27 15:28:17 -03:00
Aurélien Gâteau
ad1290b1c8 Fix build of document_api_test.cpp
Compiler could not find notifyActiveDocumentChanged.

/home/aurelien/src/aseprite/src/./doc/test_context.h: In instantiation of ‘void doc::TestContextT<Base>::onRemoveDocument(doc::Document*) [with Base = app::Context]’:
/home/aurelien/src/aseprite/src/app/document_api_tests.cpp:66:1:   required from here
/home/aurelien/src/aseprite/src/./doc/test_context.h:44:58: error: ‘notifyActiveDocumentChanged’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
         notifyActiveDocumentChanged(m_activeDoc = nullptr);
2015-04-27 18:08:21 +02:00
David Capello
8f500178fc Creating a brush with right-click clear the selected region with bg color (#154) 2015-04-27 13:03:02 -03:00
Aurélien Gâteau
db8f0e1f0d Fix aseprite binary link error
Was getting this when linking aseprite:

check_update.cpp:113: undefined reference to
net::HttpHeaders::setHeader(std::string const&, std::string const&)
2015-04-27 17:59:42 +02:00
David Capello
73fa7b2107 Define CURL_STATICLIB if we don't use libcurl shared version (might be related to #640)
This problem was introduced in d7bf504887
2015-04-27 12:23:54 -03:00
David Capello
51b6def023 Remove the "New Brush" button from the ContextBar 2015-04-27 12:07:23 -03:00
David Capello
955383f91a Add xor-ed bounding box in SelectBoxState when QUICKBOX style is enabled
This is useful when we want to select a brush in a black image (the
DARKOUTSIDE style is not useful in this case).
2015-04-27 12:03:18 -03:00
David Capello
96769d061e Rename BrushPattern::ALIGNED_FROM_SRC to ALIGNED_TO_SRC 2015-04-27 11:45:00 -03:00
David Capello
d9fb81e5d1 Now we can create brushes selecting the box directly (fix #154) 2015-04-27 11:31:48 -03:00
David Capello
215f594273 Minor renames in SelectBoxState 2015-04-27 10:19:53 -03:00
David Capello
be946ceab1 Minor change in cursor.cpp 2015-04-27 10:08:58 -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
dfeff22b2f Add possibility to create brushes from selection
Changes:
* Add doc::kImageBrushType
* Add doc::BrushPattern enum
* Add pattern and pattern origin properties to doc::Brush
* Add NewBrush and DiscardBrush commands (new Ctrl+B shortcut to create
  brushes)
* Add BrushInkProcessing
2015-04-27 00:08:04 -03:00
David Capello
98cd5056b3 Remove now unused doc::draw_brush() function 2015-04-26 16:29:23 -03:00
David Capello
4e6db14cae Use a PreviewToolLoopImpl to preview the current tool ink/point shape/etc
With this we can see the exact preview in real-time of the the left
click paiting (e.g. using real Indexed composition, ink, point shape, etc.)
We are able to preview blur, eraser, or flood fill preview too (anyway
these are not enabled at this moment).
Changes:
* Add render::ExtraType enum to indicate if the extra cel acts like a
  patch for the current cel (e.g. cursor), or as an extra layer for
  composition (e.g. selection/moving pixels)
* Add ExtraCelType property to app::Document and to render::Render
* Add ToolBox::getPointShapeById()
* As the current cursor preview depends on the current layer, when
  we change the current layer we've to update the Preview editor
  with the new selected layer (now we listen to
  Document:.onAfterLayerChanged())
* Add create_tool_loop_preview() and PreviewToolLoopImpl
2015-04-26 15:59:28 -03:00
David Capello
ae63d52027 Prepare sub point shape in SprayPointShape 2015-04-26 01:32:06 -03:00
David Capello
91eb3eecd4 Fix usage of CompressedImage scanelines width in BrushPointShape::transformPoint() 2015-04-25 21:36:33 -03:00
David Capello
bca87067eb Minor format changes in point_shapes.h 2015-04-25 20:03:25 -03:00
David Capello
8382d1ca8f Replace Brush::m_scanline with doc::CompressedImage 2015-04-25 20:01:03 -03:00
David Capello
4a05436252 Replace internal doc::Brush image with a doc::ImageRef 2015-04-25 19:41:07 -03:00
David Capello
3810cfc1fa Minor fix calling Alert::show() in ColorSelector:onFixWarningClick() 2015-04-25 16:52:14 -03:00
David Capello
eb60a4c3e7 Tabs: disable mouse wheel when we are dragging tabs 2015-04-24 19:29:57 -03:00
David Capello
c63ccf914f Keep last update information so we can show it again (fix #639)
Now the last update information retrieved from the HTTP request, is saved
in the configuration file so we can reuse it when the program is restarted.
Changes:
* Add support to compare two semvers
* Add new_version/new_url options to preferences
* Remove convert_to for base::Version (now this class is constructed from
  strings only)
2015-04-24 12:45:01 -03:00
David Capello
7e52e6d882 Use Preferences class to save the updater information 2015-04-23 19:51:53 -03:00
David Capello
d7bf504887 Fix flags to always compile with libcurl (as HomeView needs net-lib to load news) 2015-04-23 19:14:13 -03:00
David Capello
5ced5b2ee6 Don't define HomeView member functions needed for updater if ENABLE_UPDATER isn't defined (fix #624) 2015-04-23 19:05:11 -03:00
David Capello
2ea7ac6fbc Minor changes in options.xml 2015-04-23 18:33:22 -03:00
David Capello
cd07acb6a0 Don't wait in Document::lockToWrite() if timeout = 0
This fixes a lag problem using the arrow keys to move the selection
content.
2015-04-22 22:00:59 -03:00
David Capello
a2cbf3f285 Fix crash using --trim without --split-layers 2015-04-22 19:35:06 -03:00
David Capello
fe0b970131 Enable data recovery feature only if we're in GUI mode 2015-04-22 19:28:24 -03:00
David Capello
672d2b7992 Add shortcut to set zoom to 50% (close #633) 2015-04-22 19:05:16 -03:00
David Capello
f96293d1e8 Recover files with other filename to avoid confusion (related to #637) 2015-04-22 18:53:03 -03:00
David Capello
aeb1a799d7 Improve write/read stability of backup data
Now we backup 3 versions for each object. And when an object is saved
correctly on disk, a "magic number" is saved at the beginning of the file.
In this way we know that the file really represents the full object (and
a crash was not occurred in the middle of the process).
2015-04-22 16:46:57 -03:00
David Capello
8e6080af0b data_recovery.cpp: Fix TRACE() calls 2015-04-22 16:43:37 -03:00
David Capello
073831472c Catch exception if DocumentDestroyer cannot lock the document to close it 2015-04-22 16:42:55 -03:00
David Capello
134dad8d5f Use an object to implement crash::write_document() to avoid versions and dir params 2015-04-21 16:52:41 -03:00
David Capello
4b083030f1 Merge branch 'master' of git@github.com:aseprite/aseprite.git 2015-04-21 14:27:01 -03:00
David Capello
4e5860ce66 Remove (now) unnecessary update_screen_for_document() after saving process
If the sprite is locked and we cannot redraw the Editor, some defered
invalidations will be update the screen correctly.
2015-04-21 13:36:47 -03:00
David Capello
b699b92a3a Add defer_invalid_rect() to re-invalidate areas that we weren't able to paint
Sometimes, the Editor and Timeline widgets cannot be validated because the
document is locked (i.e. cannot be read). In these cases we can start a
timer to re-invalidate those areas again (and try to draw them when the
document is unlocked).
2015-04-21 13:31:24 -03:00
David Capello
34adca2933 Keep a render::Zoom instead of percentage "int" value in ZoomCommand() 2015-04-21 13:20:42 -03:00
David Capello
9fa26dc2f4 Fix problem saving transparent GIF and PNG files when the background layer is hidden 2015-04-21 13:20:36 -03:00
David Capello
2453f2de97 Add debug traces to see that we are waiting for a document lock 2015-04-21 12:15:33 -03:00
David Capello
44bf546d0d Don't wait for DocumentReader lock in Editor/Timeline::onPaint() 2015-04-21 12:14:56 -03:00