Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ref-layer' into beta (fix #532)
- Loading branch information
Showing
59 changed files
with
1,379 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Aseprite | ||
// Copyright (C) 2016 David Capello | ||
// | ||
// This program is distributed under the terms of | ||
// the End-User License Agreement for Aseprite. | ||
|
||
#ifdef HAVE_CONFIG_H | ||
#include "config.h" | ||
#endif | ||
|
||
#include "app/cmd/set_cel_bounds.h" | ||
|
||
#include "app/document.h" | ||
#include "doc/cel.h" | ||
#include "doc/document_event.h" | ||
|
||
namespace app { | ||
namespace cmd { | ||
|
||
using namespace doc; | ||
|
||
SetCelBoundsF::SetCelBoundsF(Cel* cel, const gfx::RectF& bounds) | ||
: WithCel(cel) | ||
, m_oldBounds(cel->boundsF()) | ||
, m_newBounds(bounds) | ||
{ | ||
} | ||
|
||
void SetCelBoundsF::onExecute() | ||
{ | ||
cel()->setBoundsF(m_newBounds); | ||
cel()->incrementVersion(); | ||
} | ||
|
||
void SetCelBoundsF::onUndo() | ||
{ | ||
cel()->setBoundsF(m_oldBounds); | ||
cel()->incrementVersion(); | ||
} | ||
|
||
void SetCelBoundsF::onFireNotifications() | ||
{ | ||
Cel* cel = this->cel(); | ||
DocumentEvent ev(cel->document()); | ||
ev.sprite(cel->sprite()); | ||
ev.cel(cel); | ||
cel->document()->notify_observers<DocumentEvent&>(&DocumentObserver::onCelPositionChanged, ev); | ||
} | ||
|
||
} // namespace cmd | ||
} // namespace app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Aseprite | ||
// Copyright (C) 2016 David Capello | ||
// | ||
// This program is distributed under the terms of | ||
// the End-User License Agreement for Aseprite. | ||
|
||
#ifndef APP_CMD_SET_CEL_BOUNDS_H_INCLUDED | ||
#define APP_CMD_SET_CEL_BOUNDS_H_INCLUDED | ||
#pragma once | ||
|
||
#include "app/cmd.h" | ||
#include "app/cmd/with_cel.h" | ||
#include "gfx/rect.h" | ||
|
||
namespace app { | ||
namespace cmd { | ||
using namespace doc; | ||
|
||
class SetCelBoundsF : public Cmd | ||
, public WithCel { | ||
public: | ||
SetCelBoundsF(Cel* cel, const gfx::RectF& bounds); | ||
|
||
protected: | ||
void onExecute() override; | ||
void onUndo() override; | ||
void onFireNotifications() override; | ||
size_t onMemSize() const override { | ||
return sizeof(*this); | ||
} | ||
|
||
private: | ||
gfx::RectF m_oldBounds; | ||
gfx::RectF m_newBounds; | ||
}; | ||
|
||
} // namespace cmd | ||
} // namespace app | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.