git-svn-id: svn://db.shs.com.ru/libs@288 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2017-10-03 13:47:43 +00:00
parent fc04d04e9b
commit 90d8a5f1a0
3 changed files with 137 additions and 8 deletions

View File

@@ -261,6 +261,8 @@ actions_Z_up(this), actions_Z_top(this), actions_Z_down(this), actions_Z_bottom(
connect(ui->spinHeight, SIGNAL(editingFinished()), this, SLOT(changeFinished()));
connect(ui->spinThick, SIGNAL(valueChanged(double)), this, SLOT(propertyChanged()));
connect(ui->spinThick, SIGNAL(editingFinished()), this, SLOT(changeFinished()));
connect(ui->spinScale, SIGNAL(valueChanged(double)), this, SLOT(propertyChanged()));
connect(ui->spinScale, SIGNAL(editingFinished()), this, SLOT(changeFinished()));
connect(ui->comboText, SIGNAL(editTextChanged(QString)), this, SLOT(propertyChanged()));
connect(ui->comboText->lineEdit(), SIGNAL(editingFinished()), this, SLOT(changeFinished()));
connect(ui->colorButtonPen, SIGNAL(colorChanged(QColor)), this, SLOT(propertyChanged()));
@@ -586,6 +588,7 @@ void DrawTools::selectionChanged() {
size_item.assignObject(iatext);
} else if (ipixmap) {
ui->stackedProperties->setCurrentIndex(2);
ui->spinScale->setValue(sqrt(ipixmap->transform().determinant()));
setPenBrushEnabled(false, false);
size_item.assignObject(ipixmap);
} else if (irect || iell) {
@@ -666,6 +669,16 @@ void DrawTools::propertyChanged() {
iatext->setBrush(ui->colorButtonPen->color());
iatext->setAlignment(align);
} else if (ipixmap) {
QTransform t = ipixmap->transform();
double det = sqrt(t.determinant());
QSizeF os = ipixmap->boundingRect().size() * det;
if (det != 0.) t.scale(1. / det, 1. / det);
det = ui->spinScale->value();
t.scale(det, det);
ipixmap->setTransform(t);
QSizeF ns = ipixmap->boundingRect().size() * det;
QSizeF ds = (os - ns) / 2.;
ipixmap->setPos(ipixmap->pos() + QPointF(ds.width(), ds.height()));
} else if (irect || iell) {
QAbstractGraphicsShapeItem * ishape(0);
if (irect) {