From a2cbf3f2858bb407041383fdf711cf3d634f3562 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 22 Apr 2015 19:35:06 -0300 Subject: [PATCH] Fix crash using --trim without --split-layers --- src/app/document_exporter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/document_exporter.cpp b/src/app/document_exporter.cpp index 6f00671db..e8f63a260 100644 --- a/src/app/document_exporter.cpp +++ b/src/app/document_exporter.cpp @@ -395,10 +395,13 @@ void DocumentExporter::captureSamples(Samples& samples) doc::color_t refColor = 0; if (m_trimCels) { - if (layer->isBackground()) + if (sprite->backgroundLayer() && + sprite->backgroundLayer()->isVisible()) { refColor = get_pixel(sampleRender, 0, 0); - else + } + else { refColor = sprite->transparentColor(); + } } else if (m_ignoreEmptyCels) refColor = sprite->transparentColor();