mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-19 03:54:20 +02:00
Clarify negative offset magnitude
This commit is contained in:
parent
00f979f3f7
commit
1e2706b06f
1 changed files with 3 additions and 3 deletions
|
|
@ -219,9 +219,9 @@ fn drawDigitOutline(
|
|||
|
||||
fn offsetBy(pos: usize, delta: i8) ?usize {
|
||||
if (delta < 0) {
|
||||
const sub: usize = @intCast(-delta);
|
||||
if (pos < sub) return null;
|
||||
return pos - sub;
|
||||
const abs: usize = @intCast(-delta);
|
||||
if (pos < abs) return null;
|
||||
return pos - abs;
|
||||
}
|
||||
return pos + @as(usize, @intCast(delta));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue