QTrnasform and QLineControl cleanup

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-06-07 14:06:41 +00:00
parent 644a082c7a
commit fae2d834fa
3 changed files with 12 additions and 9 deletions

View file

@ -1398,12 +1398,11 @@ QPolygonF QTransform::map(const QPolygonF &a) const
return mapProjective(*this, a);
int size = a.size();
int i;
QPolygonF p(size);
const QPointF *da = a.constData();
QPointF *dp = p.data();
for(i = 0; i < size; ++i) {
for(int i = 0; i < size; ++i) {
MAP(da[i].xp, da[i].yp, dp[i].xp, dp[i].yp);
}
return p;
@ -1428,12 +1427,11 @@ QPolygon QTransform::map(const QPolygon &a) const
return mapProjective(*this, QPolygonF(a)).toPolygon();
int size = a.size();
int i;
QPolygon p(size);
const QPoint *da = a.constData();
QPoint *dp = p.data();
for(i = 0; i < size; ++i) {
for(int i = 0; i < size; ++i) {
qreal nx = 0, ny = 0;
MAP(da[i].xp, da[i].yp, nx, ny);
dp[i].xp = qRound(nx);

View file

@ -163,9 +163,6 @@ private:
mutable uint m_type : 5;
mutable uint m_dirty : 5;
class Private;
Private *d;
};
Q_DECLARE_TYPEINFO(QTransform, Q_MOVABLE_TYPE);

View file

@ -379,11 +379,19 @@ private:
MaskInputData *m_maskData;
// undo/redo handling
enum CommandType { Separator, Insert, Remove, Delete, RemoveSelection, DeleteSelection, SetSelection };
enum CommandType {
Separator,
Insert,
Remove,
Delete,
RemoveSelection,
DeleteSelection,
SetSelection
};
struct Command {
inline Command() {}
inline Command(CommandType t, int p, QChar c, int ss, int se) : type(t),uc(c),pos(p),selStart(ss),selEnd(se) {}
uint type : 4;
CommandType type;
QChar uc;
int pos, selStart, selEnd;
};