Fix potential crash with too big shift for a label.
This commit is contained in:
parent
99985d43e0
commit
e5a9092e25
|
@ -94,8 +94,6 @@ DestinationItem VAbstractFlipping::CreateItem(quint32 idTool, const SourceItem &
|
||||||
}
|
}
|
||||||
|
|
||||||
DestinationItem item;
|
DestinationItem item;
|
||||||
item.mx = INT_MAX;
|
|
||||||
item.my = INT_MAX;
|
|
||||||
item.id = data->AddGObject(new Item(rotated));
|
item.id = data->AddGObject(new Item(rotated));
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,8 +252,8 @@ QVector<DestinationItem> VAbstractOperation::ExtractDestinationData(const QDomEl
|
||||||
{
|
{
|
||||||
DestinationItem d;
|
DestinationItem d;
|
||||||
d.id = VDomDocument::GetParametrUInt(element, AttrIdObject, NULL_ID_STR);
|
d.id = VDomDocument::GetParametrUInt(element, AttrIdObject, NULL_ID_STR);
|
||||||
d.mx = qApp->toPixel(VDomDocument::GetParametrDouble(element, AttrMx, QString::number(INT_MAX)));
|
d.mx = qApp->toPixel(VDomDocument::GetParametrDouble(element, AttrMx, QChar('1')));
|
||||||
d.my = qApp->toPixel(VDomDocument::GetParametrDouble(element, AttrMy, QString::number(INT_MAX)));
|
d.my = qApp->toPixel(VDomDocument::GetParametrDouble(element, AttrMy, QChar('1')));
|
||||||
d.showLabel = VDomDocument::GetParametrBool(element, AttrShowLabel, trueStr);
|
d.showLabel = VDomDocument::GetParametrBool(element, AttrShowLabel, trueStr);
|
||||||
destination.append(d);
|
destination.append(d);
|
||||||
}
|
}
|
||||||
|
@ -754,7 +754,7 @@ void VAbstractOperation::SaveSourceDestination(QDomElement &tag)
|
||||||
QDomElement item = doc->createElement(TagItem);
|
QDomElement item = doc->createElement(TagItem);
|
||||||
doc->SetAttribute(item, AttrIdObject, dItem.id);
|
doc->SetAttribute(item, AttrIdObject, dItem.id);
|
||||||
|
|
||||||
VAbstractSimple *obj = operatedObjects.value(dItem.id);
|
VAbstractSimple *obj = operatedObjects.value(dItem.id, nullptr);
|
||||||
|
|
||||||
doc->SetAttributeOrRemoveIf(item, AttrMx, qApp->fromPixel(dItem.mx),
|
doc->SetAttributeOrRemoveIf(item, AttrMx, qApp->fromPixel(dItem.mx),
|
||||||
obj && obj->GetType() != GOType::Point);
|
obj && obj->GetType() != GOType::Point);
|
||||||
|
|
|
@ -45,10 +45,10 @@
|
||||||
|
|
||||||
struct DestinationItem
|
struct DestinationItem
|
||||||
{
|
{
|
||||||
quint32 id;
|
quint32 id{NULL_ID};
|
||||||
qreal mx;
|
qreal mx{1};
|
||||||
qreal my;
|
qreal my{1};
|
||||||
bool showLabel;
|
bool showLabel{true};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct VAbstractOperationInitData : VDrawToolInitData
|
struct VAbstractOperationInitData : VDrawToolInitData
|
||||||
|
|
|
@ -629,8 +629,6 @@ DestinationItem VToolMove::CreateItem(quint32 idTool, const SourceItem &sItem, q
|
||||||
}
|
}
|
||||||
|
|
||||||
DestinationItem item;
|
DestinationItem item;
|
||||||
item.mx = INT_MAX;
|
|
||||||
item.my = INT_MAX;
|
|
||||||
item.id = data->AddGObject(new Item(moved));
|
item.id = data->AddGObject(new Item(moved));
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -440,8 +440,6 @@ DestinationItem VToolRotation::CreateItem(quint32 idTool, const SourceItem &sIte
|
||||||
}
|
}
|
||||||
|
|
||||||
DestinationItem item;
|
DestinationItem item;
|
||||||
item.mx = INT_MAX;
|
|
||||||
item.my = INT_MAX;
|
|
||||||
item.id = data->AddGObject(new Item(rotated));
|
item.id = data->AddGObject(new Item(rotated));
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user