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
+8 -8
View File
@@ -229,7 +229,7 @@ namespace glabels
color = XmlUtil::getUIntAttr( node, "shadow_color", 0 );
const ColorNode shadowColorNode( field_flag, color, key );
return new ModelBoxObject( x0, y0, w, h,
return new ModelBoxObject( x0, y0, w, h, false /*lockAspectRatio*/,
lineWidth, lineColorNode,
fillColorNode,
affineTransformation,
@@ -276,7 +276,7 @@ namespace glabels
color = XmlUtil::getUIntAttr( node, "shadow_color", 0 );
const ColorNode shadowColorNode( field_flag, color, key );
return new ModelEllipseObject( x0, y0, w, h,
return new ModelEllipseObject( x0, y0, w, h, false /*lockAspectRatio*/,
lineWidth, lineColorNode,
fillColorNode,
affineTransformation,
@@ -357,27 +357,27 @@ namespace glabels
if ( filenameNode.isField() )
{
return new ModelImageObject( x0, y0, w, h,
return new ModelImageObject( x0, y0, w, h, false /*lockAspectRatio*/,
filenameNode,
affineTransformation,
shadowState, shadowX, shadowY, shadowOpacity, shadowColorNode );
}
if ( data.hasImage( filename ) )
{
return new ModelImageObject( x0, y0, w, h,
return new ModelImageObject( x0, y0, w, h, false /*lockAspectRatio*/,
filename, data.getImage( filename ),
affineTransformation,
shadowState, shadowX, shadowY, shadowOpacity, shadowColorNode );
}
if ( data.hasSvg( filename ) )
{
return new ModelImageObject( x0, y0, w, h,
return new ModelImageObject( x0, y0, w, h, false /*lockAspectRatio*/,
filename, data.getSvg( filename ),
affineTransformation,
shadowState, shadowX, shadowY, shadowOpacity, shadowColorNode );
}
qWarning() << "Embedded file" << filename << "missing. Trying actual file.";
return new ModelImageObject( x0, y0, w, h,
return new ModelImageObject( x0, y0, w, h, false /*lockAspectRatio*/,
filenameNode,
affineTransformation,
shadowState, shadowX, shadowY, shadowOpacity, shadowColorNode );
@@ -419,7 +419,7 @@ namespace glabels
/* affine attrs */
const auto affineTransformation = parseAffineTransformation(node);
return new ModelBarcodeObject( x0, y0, w, h,
return new ModelBarcodeObject( x0, y0, w, h, false /*lockAspectRatio*/,
bcStyle, bcTextFlag, bcChecksumFlag, bcData, bcColorNode,
affineTransformation );
}
@@ -554,7 +554,7 @@ namespace glabels
}
const QString text = document.toPlainText();
auto textNode = new ModelTextObject( x0, y0, w, h, text,
auto textNode = new ModelTextObject( x0, y0, w, h, false /*lockAspectRatio*/, text,
fontFamily, fontSize, fontWeight, fontItalicFlag, false,
textColorNode, textHAlign, textVAlign, textWrapMode, textLineSpacing,
textAutoShrink,