Skip to content

Commit d9045c8

Browse files
committed
Turn off pointer sprite selection while a transform is active
1 parent 5659bda commit d9045c8

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

src/editor/Editor.zig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ pub const Tools = @import("Tools.zig");
1616
pub const Transform = @import("Transform.zig");
1717
pub const Keybinds = @import("Keybinds.zig");
1818

19-
const zstbi = @import("zstbi");
20-
const nfd = @import("nfd");
21-
const zmath = @import("zmath");
22-
2319
// Modules
2420
pub const Artboard = @import("Artboard.zig");
2521
pub const Explorer = @import("explorer/Explorer.zig");

src/editor/widgets/FileWidget.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ fn sample(self: *FileWidget, file: *pixi.Internal.File, point: dvui.Point, chang
227227

228228
pub fn processSpriteSelection(self: *FileWidget) void {
229229
if (pixi.editor.tools.current != .pointer) return;
230+
if (self.init_options.file.editor.transform != null) return;
231+
230232
const file = self.init_options.file;
231233

232234
for (dvui.events()) |*e| {
@@ -1886,7 +1888,7 @@ pub fn drawLayers(self: *FileWidget) void {
18861888
} }, .{ .thickness = 1, .color = dvui.themeGet().color(.control, .text), .closed = true });
18871889

18881890
// Draw the selection box for the selected sprites
1889-
if (pixi.editor.tools.current == .pointer) {
1891+
if (pixi.editor.tools.current == .pointer and file.editor.transform == null) {
18901892
var iter = file.editor.selected_sprites.iterator(.{ .kind = .set, .direction = .forward });
18911893
while (iter.next()) |i| {
18921894
const sprite_rect = file.spriteRect(i);

0 commit comments

Comments
 (0)