Compare commits

...

2 Commits

Author SHA1 Message Date
David Capello 577caa4793 Reword action names when dropping files/images onto the timeline
build / build (Debug, macos-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, macos-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, lua, cli) (push) Has been cancelled Details
build / build (Debug, windows-latest, noscripts, cli) (push) Has been cancelled Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Has been cancelled Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Has been cancelled Details
2025-09-30 08:26:44 -03:00
David Capello f3a372e78e Fix div by zero crash dropping image (fix #5447) 2025-09-30 08:24:50 -03:00
2 changed files with 4 additions and 4 deletions

View File

@ -4631,13 +4631,13 @@ void Timeline::onDrop(ui::DragEvent& e)
std::string txmsg;
std::unique_ptr<docapi::DocProvider> docProvider = nullptr;
if (droppedImage) {
txmsg = "Dropped image on timeline";
txmsg = "Drop Image";
doc::ImageRef image = nullptr;
convert_surface_to_image(surface.get(), 0, 0, surface->width(), surface->height(), image);
docProvider = std::make_unique<DocProviderFromImage>(image);
}
else {
txmsg = "Dropped paths on timeline";
txmsg = "Drop File";
docProvider = std::make_unique<DocProviderFromPaths>(m_document->context(), paths);
}

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (c) 2024 Igara Studio S.A.
// Copyright (c) 2024-2025 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -26,7 +26,7 @@ uint32_t convert_color_to_image(gfx::Color c, const os::SurfaceFormatData* fd)
uint8_t b = ((c & fd->blueMask) >> fd->blueShift);
uint8_t a = ((c & fd->alphaMask) >> fd->alphaShift);
if (fd->pixelAlpha == os::PixelAlpha::kPremultiplied) {
if (a > 0 && fd->pixelAlpha == os::PixelAlpha::kPremultiplied) {
r = r * 255 / a;
g = g * 255 / a;
b = b * 255 / a;