mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-03 21:46:20 +00:00
Minor change: use more "auto" before dynamic_cast()
This commit is contained in:
parent
d843866746
commit
44f65ad305
@ -2519,7 +2519,7 @@ void Editor::startSelectionTransformation(const gfx::Point& move, double angle)
|
|||||||
if (std::fabs(angle) > 1e-5)
|
if (std::fabs(angle) > 1e-5)
|
||||||
movingPixels->rotate(angle);
|
movingPixels->rotate(angle);
|
||||||
}
|
}
|
||||||
else if (StandbyState* standby = dynamic_cast<StandbyState*>(m_state.get())) {
|
else if (auto standby = dynamic_cast<StandbyState*>(m_state.get())) {
|
||||||
standby->startSelectionTransformation(this, move, angle);
|
standby->startSelectionTransformation(this, move, angle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2843,7 +2843,7 @@ void Editor::updateAutoCelGuides(ui::Message* msg)
|
|||||||
// tool to show automatic guides.
|
// tool to show automatic guides.
|
||||||
if (m_showAutoCelGuides &&
|
if (m_showAutoCelGuides &&
|
||||||
m_state->requireBrushPreview()) {
|
m_state->requireBrushPreview()) {
|
||||||
ui::MouseMessage* mouseMsg = dynamic_cast<ui::MouseMessage*>(msg);
|
auto mouseMsg = dynamic_cast<ui::MouseMessage*>(msg);
|
||||||
|
|
||||||
ColorPicker picker;
|
ColorPicker picker;
|
||||||
picker.pickColor(getSite(),
|
picker.pickColor(getSite(),
|
||||||
|
@ -584,7 +584,7 @@ void MovingPixelsState::onBeforeCommandExecution(CommandExecutionEvent& ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We don't need to drop the pixels if a MoveMaskCommand of Content is executed.
|
// We don't need to drop the pixels if a MoveMaskCommand of Content is executed.
|
||||||
if (MoveMaskCommand* moveMaskCmd = dynamic_cast<MoveMaskCommand*>(command)) {
|
if (auto moveMaskCmd = dynamic_cast<MoveMaskCommand*>(command)) {
|
||||||
if (moveMaskCmd->getTarget() == MoveMaskCommand::Content) {
|
if (moveMaskCmd->getTarget() == MoveMaskCommand::Content) {
|
||||||
if (layer_is_locked(m_editor)) {
|
if (layer_is_locked(m_editor)) {
|
||||||
ev.cancel();
|
ev.cancel();
|
||||||
@ -656,7 +656,7 @@ void MovingPixelsState::onBeforeCommandExecution(CommandExecutionEvent& ev)
|
|||||||
// Flip Horizontally/Vertically commands are handled manually to
|
// Flip Horizontally/Vertically commands are handled manually to
|
||||||
// avoid dropping the floating region of pixels.
|
// avoid dropping the floating region of pixels.
|
||||||
else if (command->id() == CommandId::Flip()) {
|
else if (command->id() == CommandId::Flip()) {
|
||||||
if (FlipCommand* flipCommand = dynamic_cast<FlipCommand*>(command)) {
|
if (auto flipCommand = dynamic_cast<FlipCommand*>(command)) {
|
||||||
this->flip(flipCommand->getFlipType());
|
this->flip(flipCommand->getFlipType());
|
||||||
|
|
||||||
ev.cancel();
|
ev.cancel();
|
||||||
@ -665,7 +665,7 @@ void MovingPixelsState::onBeforeCommandExecution(CommandExecutionEvent& ev)
|
|||||||
}
|
}
|
||||||
// Rotate is quite simple, we can add the angle to the current transformation.
|
// Rotate is quite simple, we can add the angle to the current transformation.
|
||||||
else if (command->id() == CommandId::Rotate()) {
|
else if (command->id() == CommandId::Rotate()) {
|
||||||
if (RotateCommand* rotate = dynamic_cast<RotateCommand*>(command)) {
|
if (auto rotate = dynamic_cast<RotateCommand*>(command)) {
|
||||||
if (rotate->flipMask()) {
|
if (rotate->flipMask()) {
|
||||||
this->rotate(rotate->angle());
|
this->rotate(rotate->angle());
|
||||||
|
|
||||||
|
@ -704,7 +704,7 @@ void StandbyState::startSelectionTransformation(Editor* editor,
|
|||||||
{
|
{
|
||||||
transformSelection(editor, NULL, NoHandle);
|
transformSelection(editor, NULL, NoHandle);
|
||||||
|
|
||||||
if (MovingPixelsState* movingPixels = dynamic_cast<MovingPixelsState*>(editor->getState().get())) {
|
if (auto movingPixels = dynamic_cast<MovingPixelsState*>(editor->getState().get())) {
|
||||||
movingPixels->translate(gfx::PointF(move));
|
movingPixels->translate(gfx::PointF(move));
|
||||||
if (std::fabs(angle) > 1e-5)
|
if (std::fabs(angle) > 1e-5)
|
||||||
movingPixels->rotate(angle);
|
movingPixels->rotate(angle);
|
||||||
@ -715,7 +715,7 @@ void StandbyState::startFlipTransformation(Editor* editor, doc::algorithm::FlipT
|
|||||||
{
|
{
|
||||||
transformSelection(editor, NULL, NoHandle);
|
transformSelection(editor, NULL, NoHandle);
|
||||||
|
|
||||||
if (MovingPixelsState* movingPixels = dynamic_cast<MovingPixelsState*>(editor->getState().get()))
|
if (auto movingPixels = dynamic_cast<MovingPixelsState*>(editor->getState().get()))
|
||||||
movingPixels->flip(flipType);
|
movingPixels->flip(flipType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user