@@ -297,7 +297,7 @@ def is_pt_enabled(self) -> bool:
297297
298298 @cached_property
299299 def has_flipside_pt (self ) -> bool :
300- return self .is_transform and self .is_flipside_creature
300+ return self .is_transform and self .is_front and self . is_flipside_creature
301301
302302 @cached_property
303303 def requires_text_shaping (self ) -> bool :
@@ -323,10 +323,12 @@ def is_centered(self) -> bool:
323323
324324 @cached_property
325325 def doc_height (self ) -> int | float :
326+ assert self .docref
326327 return self .docref .height
327328
328329 @cached_property
329330 def doc_width (self ) -> int | float :
331+ assert self .docref
330332 return self .docref .width
331333
332334 @cached_property
@@ -803,7 +805,7 @@ def textbox_reference(self) -> ReferenceLayer | None:
803805
804806 if ref :
805807 if (
806- self .is_mdfc
808+ self .is_mdfc and self . textbox_overflow_reference
807809 # and (
808810 # mdfc_mask := getLayer(
809811 # LAYERS.MDFC, [self.mask_group, LAYERS.TEXTBOX_REFERENCE]
@@ -893,7 +895,7 @@ def pt_box_shape(self) -> list[ArtLayer | None]:
893895
894896 @cached_property
895897 def flipside_pt_arrow (self ) -> ArtLayer | None :
896- if self .is_front and self . is_flipside_creature :
898+ if self .has_flipside_pt :
897899 return getLayer (
898900 "Flipside PT Arrow" ,
899901 [
@@ -1727,8 +1729,12 @@ def textbox_positioning(self) -> None:
17271729 self .expansion_symbol_layer .translate (0 , delta )
17281730
17291731 # Shift indicator
1730- if self .is_type_shifted and self .indicator_group :
1731- self .indicator_group .parent .translate (0 , delta )
1732+ if (
1733+ self .is_type_shifted
1734+ and self .indicator_group
1735+ and isinstance ((parent := self .indicator_group .parent ), LayerSet )
1736+ ):
1737+ parent .translate (0 , delta )
17321738
17331739 # Shift relevant Adventure layers
17341740 if self .is_adventure :
@@ -2108,7 +2114,7 @@ def adjust_split_textboxes_to_font_size(self):
21082114 self .layout .flavor_texts ,
21092115 self .layout .oracle_texts ,
21102116 ):
2111- if textbox_ref :
2117+ if text_layer and textbox_ref :
21122118 args .append (
21132119 {
21142120 "base_text_layer" : text_layer ,
0 commit comments