mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-28 15:53:00 +00:00
Disable blf shadow setting after use. Fixes #5387
This commit is contained in:
@@ -468,11 +468,12 @@ class BaseDecorator:
|
|||||||
|
|
||||||
blf.rotation(font_id, ang)
|
blf.rotation(font_id, ang)
|
||||||
blf.color(font_id, *color)
|
blf.color(font_id, *color)
|
||||||
# blf.enable(font_id, blf.SHADOW)
|
blf.enable(font_id, blf.SHADOW)
|
||||||
# blf.shadow(font_id, 5, 0, 0, 0, 1)
|
blf.shadow(font_id, 5, 0, 0, 0, 1)
|
||||||
# blf.shadow_offset(font_id, 1, -1)
|
blf.shadow_offset(font_id, 1, -1)
|
||||||
blf.draw(font_id, text)
|
blf.draw(font_id, text)
|
||||||
blf.disable(font_id, blf.ROTATION)
|
blf.disable(font_id, blf.ROTATION)
|
||||||
|
blf.disable(font_id, blf.SHADOW)
|
||||||
|
|
||||||
def draw_dimension_text(self, context, get_text, description, dimension_data, **draw_label_kwargs):
|
def draw_dimension_text(self, context, get_text, description, dimension_data, **draw_label_kwargs):
|
||||||
prefix = dimension_data["text_prefix"]
|
prefix = dimension_data["text_prefix"]
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ class ItemDecorator:
|
|||||||
coords_2d -= Vector((w * 0.5, h * 0.5))
|
coords_2d -= Vector((w * 0.5, h * 0.5))
|
||||||
blf.position(font_id, coords_2d[0], coords_2d[1], 0)
|
blf.position(font_id, coords_2d[0], coords_2d[1], 0)
|
||||||
blf.draw(font_id, tag)
|
blf.draw(font_id, tag)
|
||||||
|
blf.disable(font_id, blf.SHADOW)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
def transparent_color(color, alpha=0.3):
|
def transparent_color(color, alpha=0.3):
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ class GeoreferenceDecorator:
|
|||||||
location = location.normalized() * 3
|
location = location.normalized() * 3
|
||||||
text += "\n(Warning: Actual XYZ Not Shown)"
|
text += "\n(Warning: Actual XYZ Not Shown)"
|
||||||
self.draw_text_at_position(context, text, location)
|
self.draw_text_at_position(context, text, location)
|
||||||
|
blf.disable(self.font_id, blf.SHADOW)
|
||||||
|
|
||||||
def draw_text_at_position(self, context, text, position):
|
def draw_text_at_position(self, context, text, position):
|
||||||
coords_2d = location_3d_to_region_2d(context.region, context.region_data, position)
|
coords_2d = location_3d_to_region_2d(context.region, context.region_data, position)
|
||||||
|
|||||||
@@ -423,6 +423,7 @@ class PolylineDecorator:
|
|||||||
blf.color(self.font_id, *color)
|
blf.color(self.font_id, *color)
|
||||||
blf.position(self.font_id, mouse_pos[0] + offset, mouse_pos[1] - (new_line * i), 0)
|
blf.position(self.font_id, mouse_pos[0] + offset, mouse_pos[1] - (new_line * i), 0)
|
||||||
blf.draw(self.font_id, field_name + formatted_value)
|
blf.draw(self.font_id, field_name + formatted_value)
|
||||||
|
blf.disable(self.font_id, blf.SHADOW)
|
||||||
|
|
||||||
def draw_text_background(self, context, coords_dim, text_dim):
|
def draw_text_background(self, context, coords_dim, text_dim):
|
||||||
padding = 5
|
padding = 5
|
||||||
@@ -475,6 +476,7 @@ class PolylineDecorator:
|
|||||||
text_dim = blf.dimensions(self.font_id, text)
|
text_dim = blf.dimensions(self.font_id, text)
|
||||||
self.draw_text_background(context, coords_angle, text_dim)
|
self.draw_text_background(context, coords_angle, text_dim)
|
||||||
blf.draw(self.font_id, text)
|
blf.draw(self.font_id, text)
|
||||||
|
blf.disable(self.font_id, blf.SHADOW)
|
||||||
|
|
||||||
def draw_snap_point(self, context):
|
def draw_snap_point(self, context):
|
||||||
self.line_shader = gpu.shader.from_builtin("POLYLINE_UNIFORM_COLOR")
|
self.line_shader = gpu.shader.from_builtin("POLYLINE_UNIFORM_COLOR")
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class GridDecorator:
|
|||||||
coords_2d -= Vector((w * 0.5, h * 0.5))
|
coords_2d -= Vector((w * 0.5, h * 0.5))
|
||||||
blf.position(font_id, coords_2d[0], coords_2d[1], 0)
|
blf.position(font_id, coords_2d[0], coords_2d[1], 0)
|
||||||
blf.draw(font_id, tag)
|
blf.draw(font_id, tag)
|
||||||
|
blf.disable(font_id, blf.SHADOW)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
self.addon_prefs = tool.Blender.get_addon_preferences()
|
self.addon_prefs = tool.Blender.get_addon_preferences()
|
||||||
|
|||||||
Reference in New Issue
Block a user