@@ -117,6 +117,12 @@ def predefined_textbox_heights(self) -> dict[str, int]:
117117
118118 # region Settings
119119
120+ @cached_property
121+ def is_content_aware_enabled (self ) -> bool :
122+ return bool (
123+ CFG .get_setting (section = "ART" , key = "Content.Aware.Fill" , default = True )
124+ )
125+
120126 @cached_property
121127 def color_limit (self ) -> int :
122128 setting = CFG .get_setting (
@@ -447,7 +453,9 @@ def pre_render_methods(self) -> list[Callable[[], None]]:
447453
448454 @cached_property
449455 def layers_to_seek_masks_from (self ) -> Iterable [ArtLayer | LayerSet | None ]:
450- return (self .pinlines_group ,)
456+ if self .docref :
457+ return (* self .docref .layerSets , * self .docref .artLayers )
458+ return []
451459
452460 # endregion Backup
453461
@@ -1087,23 +1095,25 @@ def text_layer_rules(self) -> ArtLayer | None:
10871095 and (self .is_creature or self .has_flipside_pt )
10881096 and layer
10891097 and self .pt_text_reference
1098+ and self .textbox_reference_base
10901099 ):
1091- textbox_ref_copy = self .textbox_reference_base .duplicate (
1092- self .textbox_reference_base , ElementPlacement .PlaceBefore
1093- )
1094- textbox_ref_shape = merge_shapes (
1095- self .pt_text_reference .duplicate (
1096- textbox_ref_copy , ElementPlacement .PlaceBefore
1100+ base_dims = get_layer_dimensions (self .textbox_reference_base )
1101+ textbox_ref_shape = create_shape_layer (
1102+ (
1103+ {"x" : base_dims ["left" ], "y" : base_dims ["top" ]},
1104+ {"x" : base_dims ["right" ], "y" : base_dims ["top" ]},
1105+ {"x" : base_dims ["right" ], "y" : self .doc_height },
1106+ {"x" : base_dims ["left" ], "y" : self .doc_height },
10971107 ),
1098- textbox_ref_copy ,
1099- operation = ShapeOperation . SubtractFront ,
1108+ relative_layer = self . textbox_reference_base ,
1109+ placement = ElementPlacement . PlaceBefore ,
11001110 )
11011111 textbox_ref_shape = merge_shapes (
1102- textbox_ref_shape ,
1103- self .textbox_overflow_reference .duplicate (
1112+ self .pt_text_reference .duplicate (
11041113 textbox_ref_shape , ElementPlacement .PlaceBefore
11051114 ),
1106- operation = ShapeOperation .Unite ,
1115+ textbox_ref_shape ,
1116+ operation = ShapeOperation .SubtractFront ,
11071117 )
11081118 layer = create_text_layer_with_path (textbox_ref_shape , layer )
11091119 return layer
0 commit comments