tests
This commit is contained in:
BIN
src/__pycache__/__init__.cpython-311.pyc
Normal file
BIN
src/__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -231,7 +231,7 @@ def calculate_text_scaling(text, font, target_width, target_height):
|
||||
current_height = bbox[3] - bbox[1]
|
||||
|
||||
if current_width == 0 or current_height == 0:
|
||||
return 1.0, 1.0
|
||||
return 1.0, 1.0, 1.0
|
||||
|
||||
# Calculate scaling factors
|
||||
width_scale = target_width / current_width
|
||||
|
||||
Binary file not shown.
BIN
src/operators/__pycache__/generation_ops.cpython-311.pyc
Normal file
BIN
src/operators/__pycache__/generation_ops.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
src/operators/__pycache__/utility_ops.cpython-311.pyc
Normal file
BIN
src/operators/__pycache__/utility_ops.cpython-311.pyc
Normal file
Binary file not shown.
BIN
src/presets/__pycache__/__init__.cpython-311.pyc
Normal file
BIN
src/presets/__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
BIN
src/presets/__pycache__/migration.cpython-311.pyc
Normal file
BIN
src/presets/__pycache__/migration.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/ui/__pycache__/preview.cpython-311.pyc
Normal file
BIN
src/ui/__pycache__/preview.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -29,4 +29,39 @@ def is_free_version():
|
||||
|
||||
def is_full_version():
|
||||
"""Check if this is the full version."""
|
||||
return VERSION_TYPE == "full"
|
||||
return VERSION_TYPE == "full"
|
||||
|
||||
def sync_margin_values(props, margin_type='all'):
|
||||
"""Synchronize margin values across properties
|
||||
|
||||
Args:
|
||||
props: Properties object containing margin values
|
||||
margin_type: Type of margin sync ('all', 'horizontal', 'vertical')
|
||||
"""
|
||||
if not props:
|
||||
return
|
||||
|
||||
try:
|
||||
# Get base margin value
|
||||
base_margin = getattr(props, 'text_fitting_margin', 10.0)
|
||||
|
||||
if margin_type == 'all':
|
||||
# Sync all margins to base margin
|
||||
if hasattr(props, 'prepend_margin'):
|
||||
props.prepend_margin = base_margin
|
||||
if hasattr(props, 'append_margin'):
|
||||
props.append_margin = base_margin
|
||||
|
||||
elif margin_type == 'horizontal':
|
||||
# Sync horizontal margins
|
||||
if hasattr(props, 'prepend_margin') and hasattr(props, 'append_margin'):
|
||||
avg_margin = (props.prepend_margin + props.append_margin) / 2
|
||||
props.prepend_margin = avg_margin
|
||||
props.append_margin = avg_margin
|
||||
|
||||
elif margin_type == 'vertical':
|
||||
# Sync vertical margins (if any exist in future)
|
||||
pass
|
||||
|
||||
except Exception as e:
|
||||
print(f"Warning: Failed to sync margin values: {e}")
|
||||
Reference in New Issue
Block a user