Make lockAspectRatio (sizeAspectCheck) per-object (#63)

* Make lockAspectRatio (sizeAspectCheck) per-object
* Added unit tests for XmlLabelCreator and XmlLabelParser.
This commit is contained in:
gitlost
2019-07-14 03:18:30 +01:00
committed by Jim Evins
parent 00970d8673
commit 850c62ddd0
25 changed files with 329 additions and 54 deletions
+3
View File
@@ -188,6 +188,7 @@ namespace glabels
sizeWSpin->setValue( mObject->w().inUnits(mUnits) );
sizeHSpin->setValue( mObject->h().inUnits(mUnits) );
sizeAspectCheck->setChecked( mObject->lockAspectRatio() );
model::Size originalSize = mObject->naturalSize();
QString originalSizeString = QString( "%1: %2 x %3 %4" )
@@ -655,6 +656,7 @@ namespace glabels
if ( sizeAspectCheck->isChecked() )
{
mObject->setLockAspectRatio( true );
if ( fabs(spinW - mObject->w()) > fabs(spinH - mObject->h()) )
{
mObject->setWHonorAspect( spinW );
@@ -668,6 +670,7 @@ namespace glabels
}
else
{
mObject->setLockAspectRatio( false );
mObject->setSize( spinW, spinH );
}