Skip to content

Commit

Permalink
fix: compilation issues with win32 (win32.ScrollView)
Browse files Browse the repository at this point in the history
  • Loading branch information
zenith391 committed Dec 31, 2024
1 parent d97e1ad commit 1a4f820
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.14.0-dev.2577+271452d22

- name: Test Coverage Capy for native
run: xvfb-run -a zig build coverage
env:
Expand Down
12 changes: 6 additions & 6 deletions src/backends/win32/backend.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1526,10 +1526,10 @@ pub const ScrollView = struct {
const child = win32.GetWindow(hwnd, win32.GW_CHILD);
_ = win32.MoveWindow(
child,
@max(rect.left - parent.left, @min(0, -(@as(c_int, @intCast(preferred.width)) - width))),
@max(rect.top - parent.top, @min(0, -(@as(c_int, @intCast(preferred.height)) - height))),
@as(c_int, @intCast(preferred.width)),
@as(c_int, @intCast(preferred.height)),
@max(rect.left - parent.left, @min(0, -(@as(c_int, @intFromFloat(preferred.width)) - width))),
@max(rect.top - parent.top, @min(0, -(@as(c_int, @intFromFloat(preferred.height)) - height))),
@as(c_int, @intFromFloat(preferred.width)),
@as(c_int, @intFromFloat(preferred.height)),
1,
);

Expand All @@ -1538,7 +1538,7 @@ pub const ScrollView = struct {
.cbSize = @sizeOf(win32.SCROLLINFO),
.fMask = @as(win32.SCROLLINFO_MASK, @enumFromInt(@intFromEnum(win32.SIF_RANGE) | @intFromEnum(win32.SIF_PAGE))),
.nMin = 0,
.nMax = @as(c_int, @intCast(preferred.width)),
.nMax = @as(c_int, @intFromFloat(preferred.width)),
.nPage = @as(c_uint, @intCast(width)),
.nPos = 0,
.nTrackPos = 0,
Expand All @@ -1549,7 +1549,7 @@ pub const ScrollView = struct {
.cbSize = @sizeOf(win32.SCROLLINFO),
.fMask = @as(win32.SCROLLINFO_MASK, @enumFromInt(@intFromEnum(win32.SIF_RANGE) | @intFromEnum(win32.SIF_PAGE))),
.nMin = 0,
.nMax = @as(c_int, @intCast(preferred.height)),
.nMax = @as(c_int, @intFromFloat(preferred.height)),
.nPage = @as(c_uint, @intCast(height)),
.nPos = 0,
.nTrackPos = 0,
Expand Down

0 comments on commit 1a4f820

Please sign in to comment.