Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 122170eb authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Small fixes to multigrid, add ability to have centers and corners drawn.

parent e02b5afc
......@@ -66,6 +66,8 @@ KisWdgMultigridPattern::KisWdgMultigridPattern(QWidget* parent, const KoColorSpa
widget()->cmbConnectorType->addItem(i18n("Acute Angles"));
widget()->cmbConnectorType->addItem(i18n("Obtuse Angles"));
widget()->cmbConnectorType->addItem(i18n("Cross Shape"));
widget()->cmbConnectorType->addItem(i18n("Center Dot"));
widget()->cmbConnectorType->addItem(i18n("Corner Dot"));
connect(m_widget->sldDivisions, SIGNAL(valueChanged(int)), this, SIGNAL(sigConfigurationUpdated()));
connect(m_widget->sldDimensions, SIGNAL(valueChanged(int)), this, SIGNAL(sigConfigurationUpdated()));
......
......@@ -260,8 +260,24 @@ void KisMultigridPatternGenerator::generate(KisProcessingInformation dstInfo,
pConnect.lineTo(cl);
pConnect.closeSubpath();
gc.fillPainterPath(pConnect);
} else if (connectorType == Connector::CornerDot) {
QPointF cW(connectorWidth, connectorWidth);
QRectF dot (shape.at(0)-cW, shape.at(0)+cW);
pConnect.addEllipse(dot);
dot = QRectF(shape.at(1)-cW, shape.at(1)+cW);
pConnect.addEllipse(dot);
dot = QRectF(shape.at(2)-cW, shape.at(2)+cW);
pConnect.addEllipse(dot);
dot = QRectF(shape.at(3)-cW, shape.at(3)+cW);
pConnect.addEllipse(dot);
pConnect = pConnect.intersected(p);
} else if (connectorType == Connector::CenterDot) {
QRectF dot (center-QPointF(connectorWidth, connectorWidth), center+QPointF(connectorWidth, connectorWidth));
pConnect.addEllipse(dot);
} else {
for (int i=1; i<shape.size(); i++) {
QPainterPath pAngle;
......
......@@ -62,7 +62,9 @@ public:
None,
Acute,
Obtuse,
Cross
Cross,
CenterDot,
CornerDot
};
KisMultigridPatternGenerator();
......
......@@ -76,19 +76,15 @@
<item row="0" column="1">
<widget class="QComboBox" name="cmbConnectorType"/>
</item>
<item row="1" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spnConnectorWidth"/>
</item>
</layout>
<item row="1" column="1">
<widget class="QSpinBox" name="spnConnectorWidth"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
</layout>
</widget>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment