Skip to content

Commit

Permalink
Add default prime_line_margin
Browse files Browse the repository at this point in the history
  • Loading branch information
elpopo-eng committed Feb 24, 2024
1 parent da75f1d commit 0870c2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion macros/helpers/prime_line.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ gcode:
# Redefine start position from fl_size
{% set fl_size=printer['gcode_macro START_PRINT'].fl_size %}
{% if fl_size != "0_0_0_0" %}
{% set prime_line_margin = params.LINE_MARGIN|default(printer["gcode_macro _USER_VARIABLES"].prime_line_margin|float) %}
{% set prime_line_margin = printer["gcode_macro _USER_VARIABLES"].prime_line_margin|default(5.0|float) %}
{% set prime_line_margin = params.LINE_MARGIN|default(prime_line_margin|float) %}
{% set min_x, min_y, max_x, max_y = fl_size.split("_")|map('float') %}
{% set prime_line_x = [[prime_line_x, min_x - prime_line_margin] | max, max_x + prime_line_margin] | min %}
{% set prime_line_y = [[prime_line_y, min_y - prime_line_margin] | max, max_y + prime_line_margin] | min %}
Expand Down

0 comments on commit 0870c2f

Please sign in to comment.