Commit 56185b6f authored by Boudewijn Rempt's avatar Boudewijn Rempt

Fix a bunch of warnings

parent 8a8d0270
......@@ -31,7 +31,7 @@ struct KisRenderedDab
{
}
KisRenderedDab(const KisRenderedDab &rhs) = default;
KisRenderedDab(const KisRenderedDab &/*rhs*/) = default;
KisFixedPaintDeviceSP device;
QPoint offset;
......
......@@ -249,7 +249,7 @@ QRect KisNode::accessRect(const QRect &rect, PositionToFilthy pos) const
return rect;
}
void KisNode::childNodeChanged(KisNodeSP changedChildNode)
void KisNode::childNodeChanged(KisNodeSP /*changedChildNode*/)
{
}
......
......@@ -45,17 +45,17 @@ struct KisColorizeStrokeStrategy::Private
{
Private() : filteredSourceValid(false) {}
Private(const Private &rhs, int _levelOfDetail)
: progressNode(rhs.progressNode),
src(rhs.src),
dst(rhs.dst),
filteredSource(rhs.filteredSource),
internalFilteredSource(rhs.internalFilteredSource),
filteredSourceValid(rhs.filteredSourceValid),
boundingRect(rhs.boundingRect),
prefilterOnly(rhs.prefilterOnly),
keyStrokes(rhs.keyStrokes),
filteringOptions(rhs.filteringOptions),
levelOfDetail(_levelOfDetail)
: progressNode(rhs.progressNode)
, src(rhs.src)
, dst(rhs.dst)
, filteredSource(rhs.filteredSource)
, internalFilteredSource(rhs.internalFilteredSource)
, filteredSourceValid(rhs.filteredSourceValid)
, boundingRect(rhs.boundingRect)
, prefilterOnly(rhs.prefilterOnly)
, levelOfDetail(_levelOfDetail)
, keyStrokes(rhs.keyStrokes)
, filteringOptions(rhs.filteringOptions)
{}
KisNodeSP progressNode;
......
......@@ -112,7 +112,7 @@ QString Settings::themeID() const
return QString();
}
void Settings::setThemeID(const QString& id)
void Settings::setThemeID(const QString& /*id*/)
{
// if(!d->theme || id != d->theme->id()) {
// if(d->theme) {
......
......@@ -154,7 +154,7 @@ void ColorSelectorItem::Private::repaint()
void ColorSelectorItem::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
{
QRectF bounds = boundingRect();
// QRectF bounds = boundingRect();
// if (d->selector->configuration().subType==KisColorSelector::Ring)
// {
// d->ring->setGeometry(bounds.x(),bounds.y(),bounds.width(), bounds.height());
......
......@@ -27,7 +27,7 @@ IconImageProvider::IconImageProvider()
}
QImage IconImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
QImage IconImageProvider::requestImage(const QString &id, QSize */*size*/, const QSize &requestedSize)
{
QIcon icon = KisIconUtils::loadIcon(id);
Q_ASSERT(!icon.isNull());
......
......@@ -37,7 +37,7 @@ struct KisAsyncAnimationRendererBase::Private
static const int WAITING_FOR_FRAME_TIMEOUT = 10000;
void clearFrameRegenerationState(bool cancelled);
void clearFrameRegenerationState(bool);
};
KisAsyncAnimationRendererBase::KisAsyncAnimationRendererBase(QObject *parent)
......@@ -90,7 +90,7 @@ void KisAsyncAnimationRendererBase::cancelCurrentFrameRendering()
frameCancelledCallback(m_d->requestedFrame);
}
void KisAsyncAnimationRendererBase::Private::clearFrameRegenerationState(bool cancelled)
void KisAsyncAnimationRendererBase::Private::clearFrameRegenerationState(bool /*canceled*/)
{
imageRequestConnections.clear();
requestedImage = 0;
......
......@@ -275,7 +275,7 @@ QModelIndex KisPaletteModel::indexFromId(int i) const
if (colorSet()->nColors()==0) {
return index;
}
if (i > colorSet()->nColors()) {
if (i > (int)colorSet()->nColors()) {
qWarning()<<"index is too big"<<i<<"/"<<colorSet()->nColors();
index = this->index(0,0);
}
......@@ -292,19 +292,19 @@ QModelIndex KisPaletteModel::indexFromId(int i) const
}
int totalIndexes = colorSet()->nColorsGroup();
Q_FOREACH (QString groupName, m_colorSet->getGroupNames()){
if (i+1<=totalIndexes+colorSet()->nColorsGroup(groupName) && i+1>totalIndexes) {
int col = (i-totalIndexes)%columnCount();
int row = rowstotal+1+((i-totalIndexes)/columnCount());
if (i + 1 <= (int)(totalIndexes + colorSet()->nColorsGroup(groupName)) && i + 1 > (int)totalIndexes) {
int col = (i - totalIndexes) % columnCount();
int row = rowstotal + 1 + ((i - totalIndexes) / columnCount());
index = this->index(row, col);
return index;
} else {
rowstotal += 1+m_colorSet->nColorsGroup(groupName)/columnCount();
rowstotal += 1 + m_colorSet->nColorsGroup(groupName) / columnCount();
totalIndexes += colorSet()->nColorsGroup(groupName);
if (m_colorSet->nColorsGroup(groupName)%columnCount() > 0) {
rowstotal+=1;
rowstotal += 1;
}
if (m_colorSet->nColorsGroup(groupName)==0) {
rowstotal+=1; //always add one for the group when considering groups.
rowstotal += 1; //always add one for the group when considering groups.
}
}
}
......@@ -359,17 +359,17 @@ bool KisPaletteModel::addColorSetEntry(KoColorSetEntry entry, QString groupName)
{
int col = m_colorSet->nColorsGroup(groupName)%columnCount();
QModelIndex i = getLastEntryIndex();
if (col+1>columnCount()) {
if (col+1 > columnCount()) {
beginInsertRows(QModelIndex(), i.row(), i.row()+1);
}
if (m_colorSet->nColors()<columnCount()) {
if ((int)m_colorSet->nColors() < columnCount()) {
beginInsertColumns(QModelIndex(), m_colorSet->nColors(), m_colorSet->nColors()+1);
}
m_colorSet->add(entry, groupName);
if (col+1>columnCount()) {
if (col + 1 > columnCount()) {
endInsertRows();
}
if (m_colorSet->nColors()<columnCount()) {
if (m_colorSet->nColors() < (quint32)columnCount()) {
endInsertColumns();
}
return true;
......
......@@ -55,7 +55,7 @@ void KisGridManager::setGridConfig(const KisGridConfig &config)
setGridConfigImpl(config, true);
}
void KisGridManager::setGridConfigImpl(const KisGridConfig &config, bool emitModified)
void KisGridManager::setGridConfigImpl(const KisGridConfig &config, bool /*emitModified*/)
{
if (!m_imageView) return;
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>869</width>
<height>601</height>
<width>304</width>
<height>208</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -85,7 +85,7 @@
<string>Width:</string>
</property>
<property name="buddy">
<cstring>intSize</cstring>
<cstring>lineSize</cstring>
</property>
</widget>
</item>
......
......@@ -204,6 +204,7 @@ TabShortcutOverrider overrider2;
constexpr ShortcutOverriderBase *allShortcutOverriders[] = {
&overrider0, &overrider1, &overrider2
};
constexpr int numOfShortcutOverriders =
sizeof(allShortcutOverriders)/
sizeof(allShortcutOverriders[0]);
......@@ -217,21 +218,15 @@ struct KisQtWidgetsTweaker::Private
public:
Private(KisQtWidgetsTweaker *parent)
: q(parent)
, interestedHandlers(numOfShortcutOverriders)
, lastKeyPressProcessingComplete(true)
, decision(ShortcutOverriderBase::DecisionOnShortcutOverride::askNext)
{
}
const KisQtWidgetsTweaker *q;
QBitArray interestedHandlers = QBitArray(numOfShortcutOverriders);
ShortcutOverriderBase::DecisionOnShortcutOverride decision =
ShortcutOverriderBase::DecisionOnShortcutOverride::askNext;
//unsigned long lastEventTimestamp=0;
ShortcutOverriderBase::DecisionOnShortcutOverride decision = ShortcutOverriderBase::DecisionOnShortcutOverride::askNext;
bool lastKeyPressProcessingComplete = true;
void newPhysicalKeyPressed(QKeyEvent *event)
{
for (int i=0; i < numOfShortcutOverriders; ++i) {
......
......@@ -96,23 +96,13 @@ private:
KisPopupPalette::KisPopupPalette(KisViewManager* viewManager, KisCoordinatesConverter* coordinatesConverter ,KisFavoriteResourceManager* manager,
const KoColorDisplayRendererInterface *displayRenderer, KisCanvasResourceProvider *provider, QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint)
, m_hoveredPreset(0)
, m_hoveredColor(0)
, m_selectedColor(0)
, m_coordinatesConverter(coordinatesConverter)
, m_viewManager(viewManager)
, m_actionManager(viewManager->actionManager())
, m_resourceManager(manager)
, m_triangleColorSelector(0)
, m_displayRenderer(displayRenderer)
, m_colorChangeCompressor(new KisSignalCompressor(50, KisSignalCompressor::POSTPONE))
, m_actionCollection(viewManager->actionCollection())
, m_brushHud(0)
, m_popupPaletteSize(385.0)
, m_colorHistoryInnerRadius(72.0)
, m_colorHistoryOuterRadius(92.0)
, m_isOverCanvasRotationIndicator(false)
, m_isRotatingCanvasIndicator(false)
{
// some UI controls are defined and created based off these variables
......@@ -388,7 +378,7 @@ void KisPopupPalette::showPopupPalette(bool show)
// don't set the zoom slider if we are outside of the zoom slider bounds. It will change the zoom level to within
// the bounds and cause the canvas to jump between the slider's min and max
if (m_coordinatesConverter->zoomInPercent() > zoomSliderMinValue &&
m_coordinatesConverter->zoomInPercent() < zoomSliderMaxValue ){
m_coordinatesConverter->zoomInPercent() < zoomSliderMaxValue ){
KisSignalsBlocker b(zoomCanvasSlider);
zoomCanvasSlider->setValue(m_coordinatesConverter->zoomInPercent()); // sync the zoom slider
......@@ -466,7 +456,7 @@ void KisPopupPalette::paintEvent(QPaintEvent* e)
QPainterPath rotationTrackPath;
shrinkCircleAmount = 18;
QRectF circleRect2(shrinkCircleAmount, shrinkCircleAmount,
m_popupPaletteSize - shrinkCircleAmount*2,m_popupPaletteSize - shrinkCircleAmount*2);
m_popupPaletteSize - shrinkCircleAmount*2,m_popupPaletteSize - shrinkCircleAmount*2);
rotationTrackPath.addEllipse( circleRect2 );
pen.setWidth(1);
......@@ -507,7 +497,7 @@ void KisPopupPalette::paintEvent(QPaintEvent* e)
// hover indicator for the canvas rotation
if (m_isOverCanvasRotationIndicator == true) {
painter.save();
painter.save();
QPen pen(palette().color(QPalette::Highlight));
pen.setWidth(2);
......@@ -571,8 +561,8 @@ void KisPopupPalette::paintEvent(QPaintEvent* e)
painter.setPen(Qt::NoPen);
float rotationAngle = -360.0 / m_resourceManager->recentColorsTotal();
// there might be no recent colors at the start, so paint a placeholder
if (m_resourceManager->recentColorsTotal() == 0) {
// there might be no recent colors at the start, so paint a placeholder
if (m_resourceManager->recentColorsTotal() == 0) {
painter.setBrush(Qt::transparent);
QPainterPath emptyRecentColorsPath(drawDonutPathFull(0, 0, m_colorHistoryInnerRadius, m_colorHistoryOuterRadius));
......@@ -580,16 +570,16 @@ void KisPopupPalette::paintEvent(QPaintEvent* e)
painter.drawPath(emptyRecentColorsPath);
} else {
for (int pos = 0; pos < m_resourceManager->recentColorsTotal(); pos++) {
QPainterPath recentColorsPath(drawDonutPathAngle(m_colorHistoryInnerRadius, m_colorHistoryOuterRadius, m_resourceManager->recentColorsTotal()));
for (int pos = 0; pos < m_resourceManager->recentColorsTotal(); pos++) {
QPainterPath recentColorsPath(drawDonutPathAngle(m_colorHistoryInnerRadius, m_colorHistoryOuterRadius, m_resourceManager->recentColorsTotal()));
//accessing recent color of index pos
painter.fillPath(recentColorsPath, m_displayRenderer->toQColor( m_resourceManager->recentColorAt(pos) ));
painter.drawPath(recentColorsPath);
painter.rotate(rotationAngle);
}
//accessing recent color of index pos
painter.fillPath(recentColorsPath, m_displayRenderer->toQColor( m_resourceManager->recentColorAt(pos) ));
painter.drawPath(recentColorsPath);
painter.rotate(rotationAngle);
}
}
}
//painting hovered color
if (hoveredColor() > -1) {
......@@ -650,26 +640,26 @@ QPainterPath KisPopupPalette::drawRotationIndicator(qreal rotationAngle, bool ca
// used for canvas rotation. This function gets called twice. Once by the canvas rotation indicator,
// and another time by the reset canvas position
float canvasRotationRadians = qDegreesToRadians(rotationAngle - 90); // -90 will make 0 degrees be at the top
float rotationDialXPosition = qCos(canvasRotationRadians) * (m_popupPaletteSize/2 - 10); // m_popupPaletteSize/2 = radius
float rotationDialYPosition = qSin(canvasRotationRadians) * (m_popupPaletteSize/2 - 10);
float canvasRotationRadians = qDegreesToRadians(rotationAngle - 90); // -90 will make 0 degrees be at the top
float rotationDialXPosition = qCos(canvasRotationRadians) * (m_popupPaletteSize/2 - 10); // m_popupPaletteSize/2 = radius
float rotationDialYPosition = qSin(canvasRotationRadians) * (m_popupPaletteSize/2 - 10);
QPainterPath canvasRotationIndicator;
int canvasIndicatorSize = 15;
float canvasIndicatorMiddle = canvasIndicatorSize/2;
QRect indicatorRectangle = QRect( rotationDialXPosition - canvasIndicatorMiddle, rotationDialYPosition - canvasIndicatorMiddle,
canvasIndicatorSize, canvasIndicatorSize );
QPainterPath canvasRotationIndicator;
int canvasIndicatorSize = 15;
float canvasIndicatorMiddle = canvasIndicatorSize/2;
QRect indicatorRectangle = QRect( rotationDialXPosition - canvasIndicatorMiddle, rotationDialYPosition - canvasIndicatorMiddle,
canvasIndicatorSize, canvasIndicatorSize );
if (canDrag) {
m_canvasRotationIndicatorRect = indicatorRectangle;
} else {
m_resetCanvasRotationIndicatorRect = indicatorRectangle;
}
if (canDrag) {
m_canvasRotationIndicatorRect = indicatorRectangle;
} else {
m_resetCanvasRotationIndicatorRect = indicatorRectangle;
}
canvasRotationIndicator.addEllipse(indicatorRectangle.x(), indicatorRectangle.y(),
indicatorRectangle.width(), indicatorRectangle.height() );
canvasRotationIndicator.addEllipse(indicatorRectangle.x(), indicatorRectangle.y(),
indicatorRectangle.width(), indicatorRectangle.height() );
return canvasRotationIndicator;
return canvasRotationIndicator;
}
......@@ -691,7 +681,7 @@ void KisPopupPalette::mouseMoveEvent(QMouseEvent* event)
float rotationCorrectedXPos = m_canvasRotationIndicatorRect.x() + (m_popupPaletteSize / 2);
float rotationCorrectedYPos = m_canvasRotationIndicatorRect.y() + (m_popupPaletteSize / 2);
QRect correctedCanvasRotationIndicator = QRect(rotationCorrectedXPos, rotationCorrectedYPos,
m_canvasRotationIndicatorRect.width(), m_canvasRotationIndicatorRect.height());
m_canvasRotationIndicatorRect.width(), m_canvasRotationIndicatorRect.height());
if (correctedCanvasRotationIndicator.contains(point.x(), point.y())) {
m_isOverCanvasRotationIndicator = true;
......@@ -806,7 +796,7 @@ void KisPopupPalette::slotmirroModeClicked() {
QAction* action = m_actionCollection->action("mirror_canvas");
if (action) {
action->trigger();
action->trigger();
}
}
......@@ -814,7 +804,7 @@ void KisPopupPalette::slotCanvasonlyModeClicked() {
QAction* action = m_actionCollection->action("view_show_canvas_only");
if (action) {
action->trigger();
action->trigger();
}
}
......@@ -823,7 +813,7 @@ void KisPopupPalette::slotZoomToOneHundredPercentClicked() {
QAction* action = m_actionCollection->action("zoom_to_100pct");
if (action) {
action->trigger();
action->trigger();
}
// also move the zoom slider to 100% position so they are in sync
......
......@@ -107,14 +107,14 @@ private:
void adjustLayout(const QPoint &p);
private:
int m_hoveredPreset;
int m_hoveredColor;
int m_selectedColor;
int m_hoveredPreset {0};
int m_hoveredColor {0};
int m_selectedColor {0};
KisCoordinatesConverter* m_coordinatesConverter;
KisActionManager* m_actionManager;
KisViewManager* m_viewManager;
KisActionManager* m_actionManager;
KisFavoriteResourceManager* m_resourceManager;
KisColorSelectorInterface* m_triangleColorSelector {0};
const KoColorDisplayRendererInterface *m_displayRenderer;
......@@ -123,25 +123,25 @@ private:
QTimer m_timer;
KisBrushHud *m_brushHud;
float m_popupPaletteSize;
float m_colorHistoryInnerRadius;
float m_colorHistoryOuterRadius;
KisBrushHud *m_brushHud {0};
float m_popupPaletteSize {385.0};
float m_colorHistoryInnerRadius {72.0};
float m_colorHistoryOuterRadius {92.0};
KisRoundHudButton *m_settingsButton;
KisRoundHudButton *m_brushHudButton;
KisRoundHudButton *m_settingsButton {0};
KisRoundHudButton *m_brushHudButton {0};
QPoint m_lastCenterPoint;
QRect m_canvasRotationIndicatorRect;
QRect m_resetCanvasRotationIndicatorRect;
bool m_isOverCanvasRotationIndicator;
bool m_isRotatingCanvasIndicator;
KisHighlightedToolButton* mirrorMode;
KisHighlightedToolButton* canvasOnlyButton;
QPushButton* zoomToOneHundredPercentButton;
QSlider* zoomCanvasSlider;
int zoomSliderMinValue;
int zoomSliderMaxValue;
bool m_isOverCanvasRotationIndicator {false};
bool m_isRotatingCanvasIndicator {false};
KisHighlightedToolButton *mirrorMode {0};
KisHighlightedToolButton *canvasOnlyButton {0};
QPushButton *zoomToOneHundredPercentButton {0};
QSlider *zoomCanvasSlider {0};
int zoomSliderMinValue {10};
int zoomSliderMaxValue {200};
Q_SIGNALS:
void sigChangeActivePaintop(int);
......
......@@ -98,7 +98,7 @@ public:
void appendPlatformOpenGLDebugText(QDebug &debugOut);
#ifndef Q_OS_WIN
void appendPlatformOpenGLDebugText(QDebug &debugOut) {}
void appendPlatformOpenGLDebugText(QDebug &/*debugOut*/) {}
#endif
void appendOpenGLWarningString(KLocalizedString warning);
......
......@@ -79,7 +79,8 @@ void KisGradientSlider::paintEvent(QPaintEvent *e)
{
QWidget::paintEvent(e);
int x, y;
int x = 0;
int y = 0;
int wWidth = width() - (2 * MARGIN);
int wHeight = height();
......
......@@ -430,7 +430,7 @@ KoContactInfoDelegate::~KoContactInfoDelegate()
}
QWidget* KoContactInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
QWidget* KoContactInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/*option*/, const QModelIndex &index) const
{
if (index.column() > 0) {
......
......@@ -107,7 +107,7 @@ void KoUpdater::setAutoNestedName(const QString &name)
void KoUpdater::setInterrupted(bool value)
{
m_interrupted = true;
m_interrupted = value;
}
KoDummyUpdater::KoDummyUpdater()
......
......@@ -120,7 +120,7 @@ namespace KisAnimationUtils {
Q_FOREACH (const FrameItem &item, frames) {
const int time = item.time;
KisNodeSP node = item.node;
KisKeyframeChannel *channel;
KisKeyframeChannel *channel = 0;
if (node) {
channel = node->getKeyframeChannel(item.channel);
}
......
......@@ -77,7 +77,7 @@ void KisColorSliderInput::init()
case 10: m_name=i18n("Saturation"); break;
case 11: m_name=i18n("Luma"); break;
}
QLabel* m_label = new QLabel(i18n("%1:", m_name), this);
m_layout->addWidget(m_label);
......@@ -288,52 +288,49 @@ void KisHSXColorSliderInput::setValue(double v)
//update
void KisHSXColorSliderInput::update()
{
KoColor min = *m_color;
KoColor max = *m_color;
qreal hue, sat, val, hue_backup, sat_backup, val_backup;
// KoColor min = *m_color;
// KoColor max = *m_color;
qreal hue = 0.0;
qreal sat = 0.0;
qreal val = 0.0;
qreal hue_backup, sat_backup, val_backup;
//gets the hsv for the appropriate type//
hue_backup = m_hue;
sat_backup = m_sat;
val_backup = m_val;
switch (m_type) {
case 0:
this->converter()->getHsvF(*m_color, &hue, &sat, &val);
if (m_sliderisupdating==true)
{
if((sat*100.0)<m_sat+2 && (sat*100.0)>m_sat-2) {
sat = (sat_backup*0.01);
if (m_sliderisupdating) {
if ((sat * 100.0) < m_sat + 2 && (sat * 100.0) > m_sat - 2) {
sat = (sat_backup * 0.01);
}
if((val*100.0)<m_val+2 && (val*100.0)>m_val-2) {
if ((val * 100.0) < m_val + 2 && (val * 100.0) > m_val - 2) {
val = (val_backup*0.01);
}
}
else{
if((hue*360.0)<m_hue+2 && (hue*360.0)>m_hue-2) {
else {
if((hue * 360.0) < m_hue + 2 && (hue * 360.0) > m_hue - 2) {
hue = (hue_backup/360.0);
}
}
break;
case 1:
this->converter()->getHsvF(*m_color, &hue, &sat, &val);
if (m_sliderisupdating==true)
{
if( (hue*360.0)<m_hue+2 && (hue*360.0)>m_hue-2 ) {
if (m_sliderisupdating) {
if ((hue * 360.0) < m_hue + 2 && (hue * 360.0) > m_hue - 2 ) {
hue = (hue_backup/360.0);
}
if((val*100.0)<m_val+2 && (val*100.0)>m_val-2) {
if ((val * 100.0) < m_val + 2 && (val * 100.0) > m_val - 2) {
val = (val_backup*0.01);
}
}
else{
if((sat*100.0)<m_sat+2 && (sat*100.0)>m_sat-2) {
else {
if ((sat*100.0)<m_sat+2 && (sat*100.0)>m_sat-2) {
sat = (sat_backup*0.01);
}
}
......@@ -365,8 +362,8 @@ void KisHSXColorSliderInput::update()
if((val*100.0)<m_val+2 && (val*100.0)>m_val-2) {
val = (val_backup*0.01);
}
}
else{
if((hue*360.0)<m_hue+2 && (hue*360.0)>m_hue-2) {
......@@ -384,11 +381,11 @@ void KisHSXColorSliderInput::update()
if((val*100.0)<m_val+2 && (val*100.0)>m_val-2) {
val = (val_backup*0.01);
}
}
else{
if((sat*100.0)<m_sat+2 && (sat*100.0)>m_sat-2) {
sat = (sat_backup*0.01);
}
......@@ -421,8 +418,8 @@ void KisHSXColorSliderInput::update()
if((val*100.0)<m_val+2 && (val*100.0)>m_val-2) {
val = (val_backup*0.01);
}
}
else{
if((hue*360.0)<m_hue+2 && (hue*360.0)>m_hue-2) {
......@@ -440,11 +437,11 @@ void KisHSXColorSliderInput::update()
if((val*100.0)<m_val+2 && (val*100.0)>m_val-2) {
val = (val_backup*0.01);
}
}
else{
if((sat*100.0)<m_sat+2 && (sat*100.0)>m_sat-2) {
sat = (sat_backup*0.01);
}
......@@ -477,8 +474,8 @@ void KisHSXColorSliderInput::update()
if((val*100.0)<m_val+2 && (val*100.0)>m_val-2) {
val = (val_backup*0.01);
}
}
else{
if((hue*360.0)<m_hue+2 && (hue*360.0)>m_hue-2) {
......@@ -496,11 +493,11 @@ void KisHSXColorSliderInput::update()
if((val*100.0)<m_val+2 && (val*100.0)>m_val-2) {
val = (val_backup*0.01);
}
}
else{
if((sat*100.0)<m_sat+2 && (sat*100.0)>m_sat-2) {
sat = (sat_backup*0.01);
}
......@@ -525,27 +522,27 @@ void KisHSXColorSliderInput::update()
break;
}
//this prevents the hue going to 0 when used with grey//
if (sat<=0.0) {
m_hue = hue_backup;
}
else{
m_hue=(hue*360.0);
}
if (val==0 || val>0.999) {
m_sat = sat_backup;
}
else{
m_sat=(sat*100.0);
}
m_val=(val*100.0);
if (m_hueupdating==true){m_val=val_backup; m_sat = sat_backup; m_hueupdating=false;}
else if (m_satupdating==true){m_val=val_backup; m_hue = hue_backup; m_satupdating=false;}
else if (m_toneupdating==true){m_sat=sat_backup; m_hue = hue_backup;m_toneupdating=false;}
//sets slider and num-input according to type//
switch (m_type) {
case 0:
......@@ -690,7 +687,7 @@ void KisHSXColorSliderInput::toneUpdate(int l, int type)
if (m_type==type-1 || m_type==type-2)
{
if (l<25 || l>75){