Skip to content

Commit

Permalink
fix: fix profile option behaviour on vertex_bevel operator
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-hm committed Apr 18, 2022
1 parent c9c7e6b commit 9f22e77
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions power_mods/vertex_bevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def modal(self, context, event):
capture_modifier_keys(self, event)

width_factor = (self.base_width_factor / 10.0) if self.key_shift else self.base_width_factor
profile_factor = (self.base_profile_factor / 10.0) if self.key_shift else self.base_profile_factor
profile_factor = 0.01 if self.key_shift else 0.1
segment_factor = 1 if self.key_shift else 2

if self.key_toggle_operator_passthrough:
Expand All @@ -45,14 +45,10 @@ def modal(self, context, event):
elif self.key_increase_factor:
if self.key_no_modifiers:
self.base_width_factor = min(1, self.base_width_factor * 10.0)
elif self.key_ctrl:
self.base_profile_factor = min(1, self.base_profile_factor * 10.0)

elif self.key_decrease_factor:
if self.key_no_modifiers:
self.base_width_factor = max(0.001, self.base_width_factor / 10.0)
elif self.key_ctrl:
self.base_profile_factor = max(0.001, self.base_profile_factor / 10.0)

elif self.key_step_up:
if self.key_alt:
Expand Down Expand Up @@ -86,7 +82,7 @@ def modal(self, context, event):
if self.key_no_modifiers:
self.width = max(0, self.width + self.mouse_value)
elif self.key_ctrl:
self.profile = max(0, self.profile + self.mouse_value)
self.profile = max(0, min(1, self.profile + self.mouse_value))

self.dirty = True

Expand All @@ -103,7 +99,6 @@ def invoke(self, context, event):

self.dirty = False
self.base_width_factor = 0.01
self.base_profile_factor = 0.1

self.segments = 1
self.width = 0
Expand Down Expand Up @@ -208,7 +203,7 @@ def draw_text_callback(self):
draw_property(
self,
"Profile: {0:.2f}".format(self.profile),
"Ctrl (±{0:.2f}) | Shift + Ctrl (±{1:.2f})".format(self.base_profile_factor, self.base_profile_factor / 10),
"Ctrl (±0.1) | Shift + Ctrl (±0.01)",
active=self.key_ctrl,
alt_mode=self.key_shift_ctrl,
mouse_value=True)
Expand Down

0 comments on commit 9f22e77

Please sign in to comment.