mirror of
https://github.com/3b1b/manim.git
synced 2025-07-28 20:43:56 +08:00
Re-order conditional blocks
This commit is contained in:
@ -1310,23 +1310,6 @@ class VMobject(Mobject):
|
||||
submob.get_joint_products()
|
||||
has_fill = submob.has_fill()
|
||||
has_stroke = submob.has_stroke()
|
||||
if has_fill:
|
||||
data = submob.data[fill_names]
|
||||
data["base_point"][:] = data["point"][0]
|
||||
fill_datas.append(data)
|
||||
if self._use_winding_fill:
|
||||
# Add dummy
|
||||
fill_datas.append(data[-1:])
|
||||
else:
|
||||
fill_indices.append(submob.get_triangulation())
|
||||
# Add fill border
|
||||
if not has_stroke:
|
||||
names = list(stroke_names)
|
||||
names[names.index('stroke_rgba')] = 'fill_rgba'
|
||||
names[names.index('stroke_width')] = 'fill_border_width'
|
||||
border_stroke_data = submob.data[names]
|
||||
fill_border_datas.append(border_stroke_data)
|
||||
fill_border_datas.append(border_stroke_data[-1:])
|
||||
if has_stroke:
|
||||
lst = back_stroke_datas if submob.stroke_behind else stroke_datas
|
||||
lst.append(submob.data[stroke_names])
|
||||
@ -1334,6 +1317,24 @@ class VMobject(Mobject):
|
||||
# with a dummy vertex added at the end. This is to ensure
|
||||
# it can be safely stacked onto other stroke data arrays.
|
||||
lst.append(submob.data[stroke_names][-1:])
|
||||
if has_fill:
|
||||
data = submob.data[fill_names]
|
||||
data["base_point"][:] = data["point"][0]
|
||||
fill_datas.append(data)
|
||||
if self._use_winding_fill:
|
||||
# Add dummy, as above
|
||||
fill_datas.append(data[-1:])
|
||||
else:
|
||||
fill_indices.append(submob.get_triangulation())
|
||||
if not has_stroke and has_fill:
|
||||
# Add fill border
|
||||
names = list(stroke_names)
|
||||
names[names.index('stroke_rgba')] = 'fill_rgba'
|
||||
names[names.index('stroke_width')] = 'fill_border_width'
|
||||
border_stroke_data = submob.data[names]
|
||||
fill_border_datas.append(border_stroke_data)
|
||||
fill_border_datas.append(border_stroke_data[-1:])
|
||||
|
||||
|
||||
shader_wrappers = [
|
||||
self.back_stroke_shader_wrapper.read_in(
|
||||
|
Reference in New Issue
Block a user