prefer underscore on fields

This commit is contained in:
Halil Durak
2026-01-10 14:13:41 +03:00
parent 6ff6232316
commit ee4775eb1a

View File

@@ -29,11 +29,11 @@ const Page = @import("../../Page.zig");
const CanvasRenderingContext2D = @This(); const CanvasRenderingContext2D = @This();
/// Fill color. /// Fill color.
/// TODO: Add support for `CanvasGradient` and `CanvasPattern`. /// TODO: Add support for `CanvasGradient` and `CanvasPattern`.
fill_style: color.RGBA = color.RGBA.Named.black, _fill_style: color.RGBA = color.RGBA.Named.black,
pub fn getFillStyle(self: *const CanvasRenderingContext2D, page: *Page) ![]const u8 { pub fn getFillStyle(self: *const CanvasRenderingContext2D, page: *Page) ![]const u8 {
var w = std.Io.Writer.Allocating.init(page.call_arena); var w = std.Io.Writer.Allocating.init(page.call_arena);
try self.fill_style.format(&w.writer); try self._fill_style.format(&w.writer);
return w.written(); return w.written();
} }
@@ -42,7 +42,7 @@ pub fn setFillStyle(
value: []const u8, value: []const u8,
) !void { ) !void {
// Prefer the same fill_style if fails. // Prefer the same fill_style if fails.
self.fill_style = color.RGBA.parse(value) catch self.fill_style; self._fill_style = color.RGBA.parse(value) catch self._fill_style;
} }
pub fn getGlobalAlpha(_: *const CanvasRenderingContext2D) f64 { pub fn getGlobalAlpha(_: *const CanvasRenderingContext2D) f64 {