Skip to content

Commit 768e793

Browse files
committed
Merge branch 'main' of https://github.com/foxnne/pixi
2 parents ae30302 + 131f2b8 commit 768e793

File tree

7 files changed

+117
-12
lines changed

7 files changed

+117
-12
lines changed

.github/workflows/build.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: build
2+
on:
3+
push:
4+
paths-ignore:
5+
- "doc/**"
6+
- "README.md"
7+
- "**.md"
8+
- "LICENSE**"
9+
pull_request:
10+
paths-ignore:
11+
- "doc/**"
12+
- "README.md"
13+
- "**.md"
14+
- "LICENSE**"
15+
jobs:
16+
x86_64-linux:
17+
runs-on: ubuntu-latest
18+
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push
19+
# to the branch.
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
21+
env:
22+
DISPLAY: ':99.0'
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
- name: Setup Zig
27+
uses: mlugg/setup-zig@v1
28+
with:
29+
version: 2024.5.0-mach
30+
mirror: 'https://pkg.machengine.org/zig'
31+
- name: Get GTK3
32+
run: sudo apt install libgtk-3-dev
33+
- name: Launch xvfb
34+
run: Xvfb :99 -screen 0 1680x720x24 > /dev/null 2>&1 &
35+
- name: Build
36+
run: zig build
37+
- name: Upload Artifacts
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: x86_64-linux
41+
path: zig-out/bin
42+
- name: x86_64-linux -> x86_64-windows
43+
run: zig build -Dtarget=x86_64-windows-gnu
44+
x86_64-windows:
45+
runs-on: windows-latest
46+
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push
47+
# to the branch.
48+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
- name: Setup Zig
53+
uses: mlugg/setup-zig@v1
54+
with:
55+
version: 2024.5.0-mach
56+
mirror: 'https://pkg.machengine.org/zig'
57+
- name: Build
58+
run: zig build
59+
- name: Upload Artifacts
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: x86_64-windows
63+
path: zig-out/bin
64+
arm64-macos:
65+
runs-on: macos-14
66+
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push
67+
# to the branch.
68+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v4
72+
- name: Setup Zig
73+
uses: mlugg/setup-zig@v1
74+
with:
75+
version: 2024.5.0-mach
76+
mirror: 'https://pkg.machengine.org/zig'
77+
- name: build
78+
run: zig build -Duse_sysgpu=true
79+
- name: Upload Artifacts
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: arm64-macos
83+
path: zig-out/bin
84+
x86_64-macos:
85+
runs-on: macos-12
86+
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push
87+
# to the branch.
88+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
89+
steps:
90+
- name: Checkout
91+
uses: actions/checkout@v4
92+
- name: Setup Zig
93+
uses: mlugg/setup-zig@v1
94+
with:
95+
version: 2024.5.0-mach
96+
mirror: 'https://pkg.machengine.org/zig'
97+
- name: Build
98+
run: zig build -Duse_sysgpu=true
99+
- name: Upload Artifacts
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: x86_64-macos
103+
path: zig-out/bin

assets/pixi.atlas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"sprites":[{"name":"pencil_0_default","source":[69,0,22,23],"origin":[0,22]},{"name":"eraser_0_default","source":[91,0,22,23],"origin":[0,22]},{"name":"bucket_0_default","source":[165,0,15,19],"origin":[0,13]},{"name":"dropper_0_default","source":[113,0,21,22],"origin":[0,21]},{"name":"selection_0_default","source":[23,0,23,24],"origin":[1,22]},{"name":"selection_add_0_default","source":[0,0,23,24],"origin":[1,22]},{"name":"selection_rem_0_default","source":[46,0,23,24],"origin":[1,22]},{"name":"fox_0_default","source":[134,0,31,19],"origin":[5,20]},{"name":"logo_0_default","source":[180,0,3,6],"origin":[-10,13]}],"animations":[{"name":"pencil_default","start":0,"length":1,"fps":1},{"name":"eraser_default","start":1,"length":1,"fps":1},{"name":"bucket_default","start":2,"length":1,"fps":1},{"name":"dropper_default","start":3,"length":1,"fps":1},{"name":"selection_default","start":4,"length":1,"fps":1},{"name":"selection_add_default","start":5,"length":1,"fps":1},{"name":"selection_rem_default","start":6,"length":1,"fps":1},{"name":"fox_default","start":7,"length":1,"fps":1},{"name":"logo_default","start":8,"length":1,"fps":1}]}
1+
{"sprites":[{"name":"pencil_0_default","source":[69,0,22,22],"origin":[0,22]},{"name":"eraser_0_default","source":[91,0,22,22],"origin":[0,22]},{"name":"bucket_0_default","source":[165,0,15,18],"origin":[0,13]},{"name":"dropper_0_default","source":[113,0,21,21],"origin":[0,21]},{"name":"selection_0_default","source":[23,0,23,23],"origin":[0,23]},{"name":"selection_add_0_default","source":[0,0,23,23],"origin":[0,23]},{"name":"selection_rem_0_default","source":[46,0,23,23],"origin":[0,23]},{"name":"fox_0_default","source":[134,0,31,18],"origin":[5,20]},{"name":"logo_0_default","source":[180,0,3,5],"origin":[-10,13]}],"animations":[{"name":"pencil_default","start":0,"length":1,"fps":1},{"name":"eraser_default","start":1,"length":1,"fps":1},{"name":"bucket_default","start":2,"length":1,"fps":1},{"name":"dropper_default","start":3,"length":1,"fps":1},{"name":"selection_default","start":4,"length":1,"fps":1},{"name":"selection_add_default","start":5,"length":1,"fps":1},{"name":"selection_rem_default","start":6,"length":1,"fps":1},{"name":"fox_default","start":7,"length":1,"fps":1},{"name":"logo_default","start":8,"length":1,"fps":1}]}

assets/pixi.png

37 Bytes
Loading

assets/src/cursors.pixi

106 Bytes
Binary file not shown.

build.zig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const builtin = @import("builtin");
33

44
const mach = @import("mach");
55
const mach_gpu_dawn = @import("mach_gpu_dawn");
6-
const xcode_frameworks = @import("xcode_frameworks");
76

87
const nfd = @import("src/deps/nfd-zig/build.zig");
98
const zip = @import("src/deps/zip/build.zig");
@@ -91,13 +90,14 @@ pub fn build(b: *std.Build) !void {
9190

9291
const nfd_lib = nfd.makeLib(b, target, optimize);
9392
app.compile.root_module.addImport("nfd", nfd_lib);
94-
// if (nfd_lib.target_info.target.os.tag == .macos) {
95-
// // MacOS: this must be defined for macOS 13.3 and older.
96-
// // Critically, this MUST NOT be included as a -D__kernel_ptr_semantics flag. If it is,
97-
// // then this macro will not be defined even if `defineCMacro` was also called!
98-
// nfd_lib.defineCMacro("__kernel_ptr_semantics", "");
99-
// xcode_frameworks.addPaths(nfd_lib);
100-
// }
93+
if (target.result.isDarwin()) {
94+
// // MacOS: this must be defined for macOS 13.3 and older.
95+
// // Critically, this MUST NOT be included as a -D__kernel_ptr_semantics flag. If it is,
96+
// // then this macro will not be defined even if `defineCMacro` was also called!
97+
nfd_lib.addCMacro("__kernel_ptr_semantics", "");
98+
// xcode_frameworks.addPaths(nfd_lib);
99+
mach.addPaths(nfd_lib);
100+
}
101101
app.compile.linkLibrary(zig_imgui_dep.artifact("imgui"));
102102
app.compile.linkLibrary(zstbi.artifact("zstbi"));
103103
zip.link(app.compile);

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<h3 align=center></h3>
55
</p>
66

7+
![buildworkflow](https://github.com/foxnne/pixi/actions/workflows/build.yml/badge.svg)
8+
79
#
810
**Pixi** is an cross-platform open-source pixel art editor and animation editor written in [Zig](https://github.com/ziglang/zig).
911

src/editor/explorer/sprites.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ pub fn draw() void {
2222
defer imgui.unindent();
2323

2424
if (imgui.beginChild("Sprite", .{
25-
.x = imgui.getWindowWidth(),
26-
.y = pixi.state.settings.sprite_edit_height * pixi.content_scale[1],
25+
.x = -1.0,
26+
.y = pixi.state.settings.sprite_edit_height,
2727
}, imgui.ChildFlags_None, imgui.WindowFlags_ChildWindow)) {
2828
defer imgui.endChild();
2929

@@ -96,7 +96,7 @@ pub fn draw() void {
9696
if (imgui.collapsingHeader(pixi.fa.atlas ++ " Sprites", imgui.TreeNodeFlags_DefaultOpen)) {
9797
imgui.pushStyleVarImVec2(imgui.StyleVar_FramePadding, .{ .x = 2.0 * pixi.content_scale[0], .y = 5.0 * pixi.content_scale[1] });
9898
defer imgui.popStyleVar();
99-
if (imgui.beginChild("Sprites", .{ .x = imgui.getWindowWidth() - pixi.state.settings.explorer_grip * pixi.content_scale[0], .y = 0.0 }, imgui.ChildFlags_None, imgui.WindowFlags_ChildWindow)) {
99+
if (imgui.beginChild("Sprites", .{ .x = 0.0, .y = 0.0 }, imgui.ChildFlags_None, imgui.WindowFlags_ChildWindow)) {
100100
defer imgui.endChild();
101101

102102
for (file.sprites.items) |sprite| {

0 commit comments

Comments
 (0)