Skip to content

Commit

Permalink
chore: unify all operator value number-to-string conversion decimal p…
Browse files Browse the repository at this point in the history
…oints
  • Loading branch information
tristan-hm committed Jun 25, 2022
1 parent b832ca2 commit c505ad7
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions bevels/bevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ def draw_text_callback(self):

draw_property(
self,
"Width: {0:.1f}".format(self.width * 1000),
"(±{0:.1f}) | Shift (±{1:.1f})".format(self.base_width_factor * 1000, (self.base_width_factor / 10) * 1000),
"Width: {0:.2f}".format(self.width * 1000),
"(±{0:.2f}) | Shift (±{1:.2f})".format(self.base_width_factor * 1000, (self.base_width_factor / 10) * 1000),
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
mouse_value=True,
Expand Down
4 changes: 2 additions & 2 deletions bevels/edge_bevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def draw_text_callback(self):

draw_property(
self,
"Weight: {0:.2f} ({1:.0f})".format(self.weight, self.width * 1000 * self.weight),
"Weight: {0:.2f} ({1:.2f})".format(self.weight, self.width * 1000 * self.weight),
"(±0.1) | Shift (±0.01)",
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
Expand All @@ -375,7 +375,7 @@ def draw_text_callback(self):

draw_property(
self,
"Width: {0:.1f}".format(self.width * 1000),
"Width: {0:.2f}".format(self.width * 1000),
"Ctrl + Alt (±100) | Shift + Ctrl + Alt (±10)",
active=self.key_ctrl_alt,
alt_mode=self.key_shift_ctrl_alt,
Expand Down
4 changes: 2 additions & 2 deletions bevels/vertex_bevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ def draw_text_callback(self):

draw_property(
self,
"Width: {0:.1f}".format(self.width * 1000),
"(±{0:.1f}) | Shift (±{1:.1f})".format(self.base_width_factor * 1000, (self.base_width_factor / 10) * 1000),
"Width: {0:.2f}".format(self.width * 1000),
"(±{0:.2f}) | Shift (±{1:.2f})".format(self.base_width_factor * 1000, (self.base_width_factor / 10) * 1000),
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
mouse_value=True,
Expand Down
4 changes: 2 additions & 2 deletions bevels/weighted_normal_bevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ def draw_text_callback(self):

draw_property(
self,
"Width: {0:.1f}".format(self.width * 1000),
"(±{0:.1f}) | Shift (±{1:.1f})".format(self.base_width_factor * 1000, (self.base_width_factor / 10) * 1000),
"Width: {0:.2f}".format(self.width * 1000),
"(±{0:.2f}) | Shift (±{1:.2f})".format(self.base_width_factor * 1000, (self.base_width_factor / 10) * 1000),
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
mouse_value=True,
Expand Down
4 changes: 2 additions & 2 deletions booleans/boolean_inset.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ def draw_text_callback(self):

draw_property(
self,
"Thickness: {0:.1f}".format(self.thickness * 1000),
"(±{0:.1f}) | Shift + (±{1:.1f})".format(self.base_thickness_factor * 1000, (self.base_thickness_factor / 10) * 1000),
"Thickness: {0:.2f}".format(self.thickness * 1000),
"(±{0:.2f}) | Shift + (±{1:.2f})".format(self.base_thickness_factor * 1000, (self.base_thickness_factor / 10) * 1000),
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
mouse_value=True,
Expand Down
2 changes: 1 addition & 1 deletion deform/simple_deform.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def draw_text_callback(self):
if self.is_angular[self.methods[self.current_method]]:
draw_property(
self,
"Angle: {0:.0f}°".format(self.angle),
"Angle: {0:.2f}°".format(self.angle),
"(±10) | Shift (±1)",
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
Expand Down
8 changes: 4 additions & 4 deletions extrusion/profile_extrude.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,17 +303,17 @@ def draw_text_callback(self):

draw_property(
self,
"Extrusion: {0:.1f}".format(self.extrusion_length * 1000),
"(±{0:.1f}) | Shift + (±{1:.1f})".format(self.base_extrude_factor * 1000, (self.base_extrude_factor / 10) * 1000),
"Extrusion: {0:.2f}".format(self.extrusion_length * 1000),
"(±{0:.2f}) | Shift + (±{1:.2f})".format(self.base_extrude_factor * 1000, (self.base_extrude_factor / 10) * 1000),
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
mouse_value=True,
input_stream=self.extrusion_length_input_stream)

draw_property(
self,
"Offset: {0:.1f}".format(self.offset * 1000),
"Ctrl (±{0:.1f}) | Shift + Ctrl (±{1:.1f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
"Offset: {0:.2f}".format(self.offset * 1000),
"Ctrl (±{0:.2f}) | Shift + Ctrl (±{1:.2f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
active=self.key_ctrl,
alt_mode=self.key_shift_ctrl,
mouse_value=True,
Expand Down
6 changes: 3 additions & 3 deletions extrusion/screw.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def draw_text_callback(self):

draw_property(
self,
"Angle: {0:.0f}°".format(self.angle),
"Angle: {0:.2f}°".format(self.angle),
"Alt (±10) | Shift + Alt (±1)",
active=self.key_alt,
alt_mode=self.key_shift_alt,
Expand All @@ -309,8 +309,8 @@ def draw_text_callback(self):

draw_property(
self,
"Offset: {0:.3f}".format(self.offset),
"Ctrl (±{0:.1f}) | Shift + Ctrl (±{1:.1f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
"Offset: {0:.2f}".format(self.offset),
"Ctrl (±{0:.2f}) | Shift + Ctrl (±{1:.2f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
active=self.key_ctrl,
alt_mode=self.key_shift_ctrl,
mouse_value=True,
Expand Down
8 changes: 4 additions & 4 deletions extrusion/solidify.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,17 @@ def draw_text_callback(self):

draw_property(
self,
"Thickness: {0:.1f}".format(self.thickness * 1000),
"(±{0:.1f}) | Shift + (±{1:.1f})".format(self.base_thickness_factor * 1000, (self.base_thickness_factor / 10) * 1000),
"Thickness: {0:.2f}".format(self.thickness * 1000),
"(±{0:.2f}) | Shift + (±{1:.2f})".format(self.base_thickness_factor * 1000, (self.base_thickness_factor / 10) * 1000),
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
mouse_value=True,
input_stream=self.thickness_input_stream)

draw_property(
self,
"Offset: {0:.1f}".format(self.offset * 1000),
"Ctrl (±{0:.1f}) | Shift + Ctrl (±{1:.1f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
"Offset: {0:.2f}".format(self.offset * 1000),
"Ctrl (±{0:.2f}) | Shift + Ctrl (±{1:.2f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
active=self.key_ctrl,
alt_mode=self.key_shift_ctrl,
mouse_value=True,
Expand Down
6 changes: 3 additions & 3 deletions replicate/array_cubed.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,16 @@ def draw_text_callback(self):

draw_property(
self,
"Count: {0:.0f}".format(self.axes[self.axis][1]),
"Count: {0}".format(self.axes[self.axis][1]),
"Alt (±1)",
active=self.key_no_modifiers,
alt_mode=False,
input_stream=self.count_streams[self.axis])

draw_property(
self,
"Offset: {0:.3f}".format(self.axes[self.axis][2]),
"Ctrl (±{0:.1f}) | Shift + Ctrl (±{1:.1f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
"Offset: {0:.2f}".format(self.axes[self.axis][2]),
"Ctrl (±{0:.2f}) | Shift + Ctrl (±{1:.2f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
active=self.key_ctrl,
alt_mode=self.key_shift_ctrl,
mouse_value=True,
Expand Down
6 changes: 3 additions & 3 deletions replicate/circular_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def draw_text_callback(self):

draw_property(
self,
"Angle: {}".format('Circle (360°)' if abs(self.angle) == 360 else "Arc ({0:.1f}°)".format(self.angle)),
"Angle: {}".format('Circle (360°)' if abs(self.angle) == 360 else "Arc ({0:.2f}°)".format(self.angle)),
"Alt (±15) | Shift + Alt (±1)",
active=self.key_alt,
alt_mode=self.key_shift_alt,
Expand All @@ -411,8 +411,8 @@ def draw_text_callback(self):

draw_property(
self,
"Offset: {0:.1f}".format(self.offset * 1000),
"Ctrl (±{0:.1f}) | Shift + Ctrl (±{1:.1f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
"Offset: {0:.2f}".format(self.offset * 1000),
"Ctrl (±{0:.2f}) | Shift + Ctrl (±{1:.2f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
active=self.key_ctrl,
alt_mode=self.key_shift_ctrl,
mouse_value=True,
Expand Down
4 changes: 2 additions & 2 deletions sketch/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ def draw_text_callback(self):
if self.stage == 1:
draw_property(
self,
"Inset Amount: {0:.1f}".format(self.inset * 1000),
"(±{0:.1f}) | Shift (±{1:.1f})".format(self.base_inset_factor * 1000, (self.base_inset_factor / 10) * 1000),
"Inset Amount: {0:.2f}".format(self.inset * 1000),
"(±{0:.2f}) | Shift (±{1:.2f})".format(self.base_inset_factor * 1000, (self.base_inset_factor / 10) * 1000),
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
mouse_value=True,
Expand Down
8 changes: 4 additions & 4 deletions sketch/recon_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ def draw_text_callback(self):

draw_property(
self,
"{0}: {1:.1f}".format("Width" if self.inner_radius > 0 else "Radius", self.width * 1000),
"(±{0:.1f}) | Shift (±{1:.1f})".format(self.base_width_factor * 1000, (self.base_width_factor / 10) * 1000),
"{0}: {1:.2f}".format("Width" if self.inner_radius > 0 else "Radius", self.width * 1000),
"(±{0:.2f}) | Shift (±{1:.2f})".format(self.base_width_factor * 1000, (self.base_width_factor / 10) * 1000),
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
mouse_value=True,
Expand All @@ -429,8 +429,8 @@ def draw_text_callback(self):

draw_property(
self,
"Inner Radius: {0:.1f}".format(self.inner_radius * 1000),
"Ctrl (±{0:.1f}) | Shift + Ctrl (±{1:.1f})".format(self.base_inner_radius_factor * 1000, (self.base_inner_radius_factor / 10) * 1000),
"Inner Radius: {0:.2f}".format(self.inner_radius * 1000),
"Ctrl (±{0:.2f}) | Shift + Ctrl (±{1:.2f})".format(self.base_inner_radius_factor * 1000, (self.base_inner_radius_factor / 10) * 1000),
active=self.key_ctrl,
alt_mode=self.key_shift_ctrl,
mouse_value=True,
Expand Down
4 changes: 2 additions & 2 deletions sketch/screw_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ def draw_text_callback(self):

draw_property(
self,
"Offset: {0:.1f}".format(self.offset * 1000),
"Ctrl (±{0:.1f}) | Shift + Ctrl (±{1:.1f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
"Offset: {0:.2f}".format(self.offset * 1000),
"Ctrl (±{0:.2f}) | Shift + Ctrl (±{1:.2f})".format(self.base_offset_factor * 1000, (self.base_offset_factor / 10) * 1000),
active=self.key_ctrl,
alt_mode=self.key_shift_ctrl,
mouse_value=True,
Expand Down
4 changes: 2 additions & 2 deletions utils/flare.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def draw_text_callback(self):

draw_property(
self,
"Rotation: {0:.1f}".format(self.rotation),
"Rotation: {0:.2f}".format(self.rotation),
"(±15) | Shift (±1)",
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
Expand All @@ -341,7 +341,7 @@ def draw_text_callback(self):

draw_property(
self,
"Height Offset: {0:.1f}".format(self.height_offset),
"Height Offset: {0:.2f}".format(self.height_offset),
"Alt (±1) | Shift + Alt (±0.1)",
active=self.key_alt,
alt_mode=self.key_shift_alt,
Expand Down
2 changes: 1 addition & 1 deletion utils/seams.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def draw_text_callback(self):

draw_property(
self,
"Angle: {0:.0f}°".format(self.angle),
"Angle: {0:.2f}°".format(self.angle),
"(±{0:.0f}) | Shift + (±1)".format(self.base_angle_factor),
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
Expand Down
2 changes: 1 addition & 1 deletion utils/smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def draw_text_callback(self):

draw_property(
self,
"Angle: {0:.0f}°".format(self.angle),
"Angle: {0:.2f}°".format(self.angle),
"(±{0:.0f}) | Shift + (±1)".format(self.base_angle_factor),
active=self.key_no_modifiers,
alt_mode=self.key_shift_no_modifiers,
Expand Down

0 comments on commit c505ad7

Please sign in to comment.