Don't show onion skin in the mini editor

This commit is contained in:
David Capello 2014-05-08 08:50:21 -03:00
parent 391a5c0bf4
commit 695243006f
5 changed files with 21 additions and 14 deletions

View File

@ -140,10 +140,13 @@ void PreviewCommand::onExecute(Context* context)
// Render sprite and leave the result in 'render' variable
if (render == NULL) {
RenderEngine renderEngine(document, sprite,
editor->getLayer(),
editor->getFrame());
render.reset(renderEngine.renderSprite(0, 0, sprite->getWidth(), sprite->getHeight(),
editor->getFrame(), 0, false));
editor->getLayer(),
editor->getFrame());
render.reset(
renderEngine.renderSprite(
0, 0, sprite->getWidth(), sprite->getHeight(),
editor->getFrame(), 0, false, false));
}
// Redraw the screen

View File

@ -387,7 +387,8 @@ void Editor::drawOneSpriteUnclippedRect(ui::Graphics* g, const gfx::Rect& rc, in
try {
rendered.reset(renderEngine.renderSprite(
source_x, source_y, width, height,
m_frame, m_zoom, true));
m_frame, m_zoom, true,
((m_flags & kShowOnionskin) == kShowOnionskin)));
}
catch (const std::exception& e) {
Console::showException(e);

View File

@ -67,7 +67,8 @@ namespace app {
kNoneFlag = 0,
kShowGridFlag = 1,
kShowMaskFlag = 2,
kDefaultEditorFlags = kShowGridFlag | kShowMaskFlag,
kShowOnionskin = 4,
kDefaultEditorFlags = kShowGridFlag | kShowMaskFlag | kShowOnionskin,
};
enum ZoomBehavior {

View File

@ -1,5 +1,5 @@
/* Aseprite
* Copyright (C) 2001-2013 David Capello
* Copyright (C) 2001-2014 David Capello
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -376,9 +376,10 @@ void RenderEngine::setPreviewImage(const Layer* layer, Image* image)
zoom applied (sorce_x<<zoom, source_y<<zoom, width<<zoom, etc.)
*/
Image* RenderEngine::renderSprite(int source_x, int source_y,
int width, int height,
FrameNumber frame, int zoom,
bool draw_tiled_bg)
int width, int height,
FrameNumber frame, int zoom,
bool draw_tiled_bg,
bool enable_onionskin)
{
void (*zoomed_func)(Image*, const Image*, const Palette*, int, int, int, int, int);
const LayerImage* background = m_sprite->getBackgroundLayer();
@ -421,7 +422,7 @@ Image* RenderEngine::renderSprite(int source_x, int source_y,
IDocumentSettings* docSettings = UIContext::instance()
->getSettings()->getDocumentSettings(m_document);
if (docSettings->getUseOnionskin()) {
if (enable_onionskin & docSettings->getUseOnionskin()) {
// Draw background layer of the current frame with opacity=255
global_opacity = 255;
renderLayer(m_sprite->getFolder(), image,

View File

@ -69,9 +69,10 @@ namespace app {
// Main function used by sprite-editors to render the sprite
Image* renderSprite(int source_x, int source_y,
int width, int height,
FrameNumber frame, int zoom,
bool draw_tiled_bg);
int width, int height,
FrameNumber frame, int zoom,
bool draw_tiled_bg,
bool enable_onionskin);
//////////////////////////////////////////////////////////////////////
// Extra functions