Return type of field of property instead of property.
This commit is contained in:
@@ -12,11 +12,11 @@ const default_thickness: f32 = 2.0;
|
||||
|
||||
/// Линия от (0,0) до end_point.
|
||||
pub fn draw(ctx: *DrawContext, obj: *const Object) void {
|
||||
const ep_prop = obj.getProperty(.end_point) orelse return;
|
||||
const end_x = ep_prop.end_point.x;
|
||||
const end_y = ep_prop.end_point.y;
|
||||
const stroke = if (obj.getProperty(.stroke_rgba)) |s| pipeline.rgbaToPma(s.stroke_rgba) else default_stroke;
|
||||
const thickness = if (obj.getProperty(.thickness)) |t| t.thickness else default_thickness;
|
||||
const end_point = obj.getProperty(.end_point) orelse return;
|
||||
const end_x = end_point.x;
|
||||
const end_y = end_point.y;
|
||||
const stroke = if (obj.getProperty(.stroke_rgba)) |stroke_rgba| pipeline.rgbaToPma(stroke_rgba) else default_stroke;
|
||||
const thickness = obj.getProperty(.thickness) orelse default_thickness;
|
||||
drawLine(ctx, 0, 0, end_x, end_y, stroke, thickness, false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user