Return type of field of property instead of property.

This commit is contained in:
andrew.kraevskii
2026-03-04 01:13:03 +03:00
parent e3a4506194
commit cc10d806fe
7 changed files with 28 additions and 29 deletions

View File

@@ -16,10 +16,10 @@ pub const Transform = struct {
opacity: f32 = 1.0,
pub fn init(obj: *const Document.Object) Transform {
const pos = if (obj.getProperty(.position)) |p| p.position else Point2_f{ .x = 0, .y = 0 };
const angle = if (obj.getProperty(.angle)) |p| p.angle else 0;
const scale = if (obj.getProperty(.scale)) |p| p.scale else Scale2_f{ .scale_x = 1, .scale_y = 1 };
const opacity = if (obj.getProperty(.opacity)) |p| p.opacity else 1.0;
const pos = obj.getProperty(.position) orelse Point2_f{ .x = 0, .y = 0 };
const angle = obj.getProperty(.angle) orelse 0;
const scale = obj.getProperty(.scale) orelse Scale2_f{ .scale_x = 1, .scale_y = 1 };
const opacity = obj.getProperty(.opacity) orelse 1.0;
return .{
.position = pos,
.angle = angle,