Compare commits

...

4 Commits

Author SHA1 Message Date
Martín Capello f9777f14f2
Merge 1e556678ba into cef92c1a38 2025-07-30 20:13:18 +01:00
David Capello cef92c1a38 Add .plist files for macOS
build-auto / build-auto (Debug, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (Debug, windows-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, macos-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, ubuntu-latest) (push) Has been cancelled Details
build-auto / build-auto (RelWithDebInfo, windows-latest) (push) Has been cancelled Details
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
We don't have an Aseprite.app target in cmake files yet, but we might
add it in a near future.
2025-07-28 16:18:19 -03:00
Christian Kaiser 22e72ab5cb [win] Fix includeDesktopDir returning the default path
build / build (Debug, macos-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, macos-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, ubuntu-latest, noscripts, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, lua, cli) (push) Waiting to run Details
build / build (Debug, windows-latest, noscripts, cli) (push) Waiting to run Details
build / build (RelWithDebInfo, macos-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, ubuntu-latest, lua, gui) (push) Waiting to run Details
build / build (RelWithDebInfo, windows-latest, lua, gui) (push) Waiting to run Details
Uses SHGFP_TYPE_CURRENT which returns the Desktop that the user has configured instead of the default, fixes Windows 11's OneDrive Desktop folder.
2025-07-28 10:47:53 -03:00
Martín Capello 1e556678ba Fix crash dropping file on timeline (fix #5289) 2025-07-23 17:56:07 -03:00
8 changed files with 124 additions and 5 deletions

View File

@ -180,8 +180,8 @@ if(ENABLE_ASEPRITE_EXE)
if(WIN32) if(WIN32)
set(main_resources set(main_resources
main/resources_win32.rc main/win/resources_win32.rc
main/settings.manifest) main/win/settings.manifest)
endif() endif()
add_executable(${main_target} add_executable(${main_target}

View File

@ -213,7 +213,7 @@ void ResourceFinder::includeDesktopDir(const char* filename)
#ifdef _WIN32 #ifdef _WIN32
std::vector<wchar_t> buf(MAX_PATH); std::vector<wchar_t> buf(MAX_PATH);
HRESULT hr = SHGetFolderPath(NULL, CSIDL_DESKTOPDIRECTORY, NULL, SHGFP_TYPE_DEFAULT, &buf[0]); HRESULT hr = SHGetFolderPath(NULL, CSIDL_DESKTOP, NULL, SHGFP_TYPE_CURRENT, &buf[0]);
if (hr == S_OK) { if (hr == S_OK) {
addPath(base::join_path(base::to_utf8(&buf[0]), filename)); addPath(base::join_path(base::to_utf8(&buf[0]), filename));
} }

View File

@ -168,6 +168,21 @@ SelectLayerBoundariesOp get_select_layer_in_canvas_op(ui::Message* msg)
return SelectLayerBoundariesOp::REPLACE; return SelectLayerBoundariesOp::REPLACE;
} }
bool get_layer_index(LayerGroup* parent, const Layer* layer, layer_t& index)
{
for (Layer* child : parent->layers()) {
if (child->isGroup() && get_layer_index(static_cast<LayerGroup*>(child), layer, index)) {
return index;
}
if (child == layer) {
return true;
}
index++;
}
return false;
}
} // anonymous namespace } // anonymous namespace
Timeline::Hit::Hit(int part, layer_t layer, col_t frame, ObjectId tag, int band) Timeline::Hit::Hit(int part, layer_t layer, col_t frame, ObjectId tag, int band)
@ -4055,6 +4070,12 @@ layer_t Timeline::getLayerIndex(const Layer* layer) const
return -1; return -1;
} }
layer_t Timeline::getLayerIndexFromSprite(const Layer* layer) const
{
layer_t index = 0;
return get_layer_index(m_sprite->root(), layer, index) ? index : -1;
}
bool Timeline::isLayerActive(const layer_t layerIndex) const bool Timeline::isLayerActive(const layer_t layerIndex) const
{ {
Layer* layer = getLayer(layerIndex); Layer* layer = getLayer(layerIndex);
@ -4576,7 +4597,7 @@ void Timeline::onDrop(ui::DragEvent& e)
// Determine at which frame and layer the content was dropped on. // Determine at which frame and layer the content was dropped on.
frame_t frame = m_frame; frame_t frame = m_frame;
layer_t layerIndex = getLayerIndex(m_layer); layer_t layerIndex = getLayerIndexFromSprite(m_layer);
InsertionPoint insert = InsertionPoint::BeforeLayer; InsertionPoint insert = InsertionPoint::BeforeLayer;
DroppedOn droppedOn = DroppedOn::Unspecified; DroppedOn droppedOn = DroppedOn::Unspecified;
TRACE("m_dropRange.type() %d\n", m_dropRange.type()); TRACE("m_dropRange.type() %d\n", m_dropRange.type());
@ -4602,7 +4623,7 @@ void Timeline::onDrop(ui::DragEvent& e)
break; break;
case Range::kLayers: case Range::kLayers:
droppedOn = DroppedOn::Layer; droppedOn = DroppedOn::Layer;
if (m_dropTarget.vhit != DropTarget::VeryBottom) { if (m_dropTarget.vhit != DropTarget::VeryBottom && !m_dropRange.selectedLayers().empty()) {
auto* selectedLayer = *m_dropRange.selectedLayers().begin(); auto* selectedLayer = *m_dropRange.selectedLayers().begin();
layerIndex = getLayerIndex(selectedLayer); layerIndex = getLayerIndex(selectedLayer);
} }

View File

@ -355,6 +355,8 @@ private:
gfx::Point getMaxScrollablePos() const; gfx::Point getMaxScrollablePos() const;
doc::Layer* getLayer(int layerIndex) const; doc::Layer* getLayer(int layerIndex) const;
layer_t getLayerIndex(const Layer* layer) const; layer_t getLayerIndex(const Layer* layer) const;
// Get layer index regardless of visibility in the UI.
layer_t getLayerIndexFromSprite(const Layer* layer) const;
bool isLayerActive(const layer_t layerIdx) const; bool isLayerActive(const layer_t layerIdx) const;
bool isFrameActive(const col_t frame) const; bool isFrameActive(const col_t frame) const;
bool isCelActive(const layer_t layerIdx, const col_t frame) const; bool isCelActive(const layer_t layerIdx, const col_t frame) const;

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>

86
src/main/osx/Info.plist Normal file
View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>aseprite</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>Document.icns</string>
<key>CFBundleTypeName</key>
<string>Aseprite Sprite</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>ase</string>
<string>bmp</string>
<string>flc</string>
<string>fli</string>
<string>gif</string>
<string>ico</string>
<string>jpeg</string>
<string>jpg</string>
<string>pcx</string>
<string>png</string>
<string>tga</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>Document.icns</string>
<key>CFBundleTypeName</key>
<string>Aseprite Sprite</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>aseprite-extension</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>Extension.icns</string>
<key>CFBundleTypeName</key>
<string>Aseprite Extension</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
</array>
<key>CFBundleDisplayName</key>
<string>Aseprite</string>
<key>CFBundleExecutable</key>
<string>aseprite</string>
<key>CFBundleIdentifier</key>
<string>org.aseprite.Aseprite</string>
<key>CFBundleName</key>
<string>Aseprite</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>1.3</string>
<key>CFBundleVersion</key>
<string>1.3</string>
<key>CFBundleIconFile</key>
<string>Aseprite.icns</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.graphics-design</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2001-2025, Igara Studio S.A.
All rights reserved.</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>NSRequiresAquaSystemAppearance</key>
<false/>
</dict>
</plist>