koffice/krita/plugins/paintops
Cyrille Berger
cyb at lepi.org
Thu Apr 30 20:52:39 CEST 2009
SVN commit 961814 by berger:
Fix: the smudge op (make it do something, fix it wrt to size need to be activated, correct range)
Can someone review for backporting ?
CCMAIL:kimageshop at kde.org
M +1 -14 defaultpaintops/smudge/kis_smudgeop.cpp
M +0 -3 defaultpaintops/smudge/kis_smudgeop.h
M +10 -4 libpaintop/kis_pressure_rate_option.cpp
--- trunk/koffice/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.cpp #961813:961814
@@ -147,7 +147,7 @@
*/
int opacity = OPACITY_OPAQUE;
if (!m_firstRun) {
- opacity = settings->m_optionsWidget->m_rateOption->apply( opacity, sw, sh, m_srcdev, adjustedInfo.pressure() );
+ opacity = settings->m_optionsWidget->m_rateOption->apply( opacity, sw, sh, m_srcdev, info.pressure() );
KisRectIterator it = m_srcdev->createRectIterator(0, 0, sw, sh);
KoColorSpace* cs = m_srcdev->colorSpace();
@@ -186,16 +186,3 @@
//painter()->setOpacity(origOpacity);
}
-
-double KisSmudgeOp::paintLine(const KisPaintInformation &pi1,
- const KisPaintInformation &pi2,
- double savedDist)
-{
- KisPaintInformation adjustedInfo1(pi1);
- KisPaintInformation adjustedInfo2(pi2);
- if (!settings->m_optionsWidget->m_sizeOption->isChecked()) {
- adjustedInfo1.setPressure(PRESSURE_DEFAULT);
- adjustedInfo2.setPressure(PRESSURE_DEFAULT);
- }
- return KisPaintOp::paintLine(adjustedInfo1, adjustedInfo2, savedDist);
-}
--- trunk/koffice/krita/plugins/paintops/defaultpaintops/smudge/kis_smudgeop.h #961813:961814
@@ -56,9 +56,6 @@
virtual ~KisSmudgeOp();
void paintAt(const KisPaintInformation& info);
- virtual double paintLine(const KisPaintInformation &pi1,
- const KisPaintInformation &pi2,
- double savedDist = -1);
private:
--- trunk/koffice/krita/plugins/paintops/libpaintop/kis_pressure_rate_option.cpp #961813:961814
@@ -59,7 +59,7 @@
int KisPressureRateOption::rate() const
{
- return m_rateSlider->value();
+ return (m_rateSlider->value() * 255) / 100;
}
void KisPressureRateOption::writeOptionSetting(KisPropertiesConfiguration* setting) const
@@ -83,16 +83,19 @@
if (isChecked()) {
if (customCurve()) {
opacity = qBound((qint32)OPACITY_TRANSPARENT,
- (qint32)(double(opacity) * scaleToCurve(pressure)),
+ (qint32)(double(opacity) * scaleToCurve(pressure) / PRESSURE_DEFAULT),
(qint32)OPACITY_OPAQUE);
} else {
opacity = qBound((qint32)OPACITY_TRANSPARENT,
- (qint32)(double(opacity) * pressure),
+ (qint32)(double(opacity) * pressure / PRESSURE_DEFAULT),
(qint32)OPACITY_OPAQUE);
}
}
+#if 0
+ // TODO It's also applied in the smudgeop, do other paintops that require a rate
+ // needs to do this to their srcDev ?
KisRectIterator it = srcdev->createRectIterator(0, 0, sw, sh);
KoColorSpace* cs = srcdev->colorSpace();
@@ -100,8 +103,11 @@
cs->setAlpha(it.rawData(), (cs->alpha(it.rawData()) * opacity) / OPACITY_OPAQUE, 1);
++it;
}
-
return OPACITY_OPAQUE - opacity;
+#else
+ return opacity;
+#endif
+
}
More information about the kimageshop
mailing list