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 9ccdb44e authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Adjust color effects, change ui a little.

parent d766feeb
......@@ -44,10 +44,10 @@ KisWdgMultigridPattern::KisWdgMultigridPattern(QWidget* parent, const KoColorSpa
widget()->sldOffset->setRange(0.01, 0.49, 2);
widget()->sldOffset->setPrefix(i18n("Offset:"));
widget()->sldColorRatio->setRange(0.0, 1.0, 2);
widget()->sldColorRatio->setRange(-2.0, 2.0, 2);
widget()->sldColorRatio->setPrefix(i18n("Ratio:"));
widget()->sldColorIndex->setRange(0.0, 1.0, 2);
widget()->sldColorIndex->setRange(-1.0, 1.0, 2);
widget()->sldColorIndex->setPrefix(i18n("Index:"));
widget()->sldColorIntersect->setRange(0.0, 1.0, 2);
......
......@@ -81,7 +81,7 @@ KisFilterConfigurationSP KisMultigridPatternGenerator::defaultConfiguration(KisR
c.fromQColor(QColor(Qt::black));
v.setValue(c);
config->setProperty("lineColor", v);
config->setProperty("divisions", 1);
config->setProperty("divisions", 5);
config->setProperty("lineWidth", 1);
config->setProperty("dimensions", 5);
config->setProperty("offset", .2);
......@@ -161,8 +161,8 @@ void KisMultigridPatternGenerator::generate(KisProcessingInformation dstInfo,
QPolygonF shape = tf.map(rhomb.shape);
QPointF center = shape.at(0)+shape.at(1)+shape.at(2)+shape.at(3);
center.setX(center.x()/4);
center.setY(center.y()/4);
center.setX(center.x()/4.0);
center.setY(center.y()/4.0);
QTransform lineWidthTransform;
......@@ -188,19 +188,20 @@ void KisMultigridPatternGenerator::generate(KisProcessingInformation dstInfo,
qreal intersectRatio = qreal(rhomb.line1)/qreal(dimensions);
intersectRatio += qreal(rhomb.line2)/qreal(dimensions);
intersectRatio *= 0.5;
qreal divisionRatio = 1-abs(qreal(rhomb.parallel1)/qreal(divisions));
divisionRatio *= 1-abs(qreal(rhomb.parallel2)/qreal(divisions));
qreal indexRatio = 1-abs(qreal(rhomb.parallel1)/qreal(divisions/2.0));
indexRatio *= 1-abs(qreal(rhomb.parallel2)/qreal(divisions/2.0));
if (colorRatio!=0) {
if (colorRatio>=0) {
gradientPos *= (shapeRatio*colorRatio);
} else {
gradientPos *= 1-(shapeRatio*abs(colorRatio));
}
if (colorIntersect!=0) {
gradientPos *= (intersectRatio*colorIntersect);
}
if (colorIndex!=0) {
gradientPos *= (divisionRatio*colorIndex);
gradientPos *= 1-(intersectRatio*colorIntersect);
if (colorIndex>=0) {
gradientPos *= 1-(indexRatio*colorIndex);
} else {
gradientPos *= 1-((1-indexRatio)*abs(colorIndex));
}
grad.colorAt(c, gradientPos);
......
......@@ -10,24 +10,8 @@
<height>440</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>21</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Shapes</string>
......@@ -45,23 +29,36 @@
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>21</height>
</size>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Lines</string>
</property>
</spacer>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Line Color: </string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KisColorButton" name="bnLineColor"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Line Width:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spnLineWidth"/>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Colors</string>
......@@ -111,35 +108,6 @@
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Lines</string>
</property>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Line Color: </string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KisColorButton" name="bnLineColor"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Line Width:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spnLineWidth"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
......
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