r23109 by jghali - Simplify PageItem's gradient API

scribus-commit scribus-commit at lists.scribus.net
Tue Aug 6 05:14:09 UTC 2019


Author: jghali
Date: Tue Aug  6 05:14:09 2019
New Revision: 23109

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23109
Log:
Simplify PageItem's gradient API

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/ui/propertiespalette.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23109&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Tue Aug  6 05:14:09 2019
@@ -5466,44 +5466,19 @@
 		restoreGradientMeshColor(ss, isUndo);
 		return true;
 	}
-	if (ss->contains("GRADSTROKE_STARTX"))
-	{
-		restoreGradientStrokeStartX(ss, isUndo);
+	if (ss->contains("GRADSTROKE_START"))
+	{
+		restoreGradientStrokeStart(ss, isUndo);
 		return true;
 	}
-	if (ss->contains("GRADSTROKE_STARTY"))
-	{
-		restoreGradientStrokeStartY(ss, isUndo);
+	if (ss->contains("GRADSTROKE_END"))
+	{
+		restoreGradientStrokeEnd(ss, isUndo);
 		return true;
 	}
-	if (ss->contains("GRADSTROKE_ENDX"))
-	{
-		restoreGradientStrokeEndX(ss, isUndo);
-		return true;
-	}
-	if (ss->contains("GRADSTROKE_ENDY"))
-	{
-		restoreGradientStrokeEndY(ss, isUndo);
-		return true;
-	}
-	if (ss->contains("GRADSTROKE_FOCALX"))
-	{
-		restoreGradientStrokeFocalX(ss, isUndo);
-		return true;
-	}
-	if (ss->contains("GRADSTROKE_FOCALY"))
-	{
-		restoreGradientStrokeFocalY(ss, isUndo);
-		return true;
-	}
-	if (ss->contains("GRAD_MASKFOCALX"))
-	{
-		restoreGradientMaskFocalX(ss, isUndo);
-		return true;
-	}
-	if (ss->contains("GRAD_MASKFOCALY"))
-	{
-		restoreGradientMaskFocalY(ss, isUndo);
+	if (ss->contains("GRADSTROKE_FOCAL"))
+	{
+		restoreGradientStrokeFocal(ss, isUndo);
 		return true;
 	}
 	if (ss->contains("GRADSTROKE_SCALE"))
@@ -5576,24 +5551,19 @@
 		restoreGradientMaskSkew(ss, isUndo);
 		return true;
 	}
-	if (ss->contains("GRAD_MASKSTARTX"))
-	{
-		restoreGradientMaskStartX(ss, isUndo);
+	if (ss->contains("GRAD_MASKSTART"))
+	{
+		restoreGradientMaskStart(ss, isUndo);
 		return true;
 	}
-	if (ss->contains("GRAD_MASKSTARTY"))
-	{
-		restoreGradientMaskStartY(ss, isUndo);
+	if (ss->contains("GRAD_MASKEND"))
+	{
+		restoreGradientMaskEnd(ss, isUndo);
 		return true;
 	}
-	if (ss->contains("GRAD_MASKENDX"))
-	{
-		restoreGradientMaskEndX(ss, isUndo);
-		return true;
-	}
-	if (ss->contains("GRAD_MASKENDY"))
-	{
-		restoreGradientMaskEndY(ss, isUndo);
+	if (ss->contains("GRAD_MASKFOCAL"))
+	{
+		restoreGradientMaskFocal(ss, isUndo);
 		return true;
 	}
 	if (ss->contains("GRAD_TYPE"))
@@ -6275,52 +6245,46 @@
 		GrSkew = is->getDouble("NEW");
 }
 
-void PageItem::restoreGradientMaskStartX(SimpleState *is, bool isUndo)
+void PageItem::restoreGradientMaskStart(SimpleState *is, bool isUndo)
 {
 	if (isUndo)
-		GrMaskStartX = is->getDouble("OLD");
-	else
-		GrMaskStartX = is->getDouble("NEW");
-}
-
-void PageItem::restoreGradientMaskStartY(SimpleState *is, bool isUndo)
+	{
+		GrMaskStartX = is->getDouble("OLDX");
+		GrMaskStartY = is->getDouble("OLDY");
+	}
+	else
+	{
+		GrMaskStartX = is->getDouble("NEWX");
+		GrMaskStartY = is->getDouble("NEWY");
+	}
+}
+
+void PageItem::restoreGradientMaskEnd(SimpleState *is, bool isUndo)
 {
 	if (isUndo)
-		GrMaskStartY = is->getDouble("OLD");
-	else
-		GrMaskStartY = is->getDouble("NEW");
-}
-
-void PageItem::restoreGradientMaskEndX(SimpleState *is, bool isUndo)
+	{
+		GrMaskEndX = is->getDouble("OLDX");
+		GrMaskEndY = is->getDouble("OLDY");
+	}
+	else
+	{
+		GrMaskEndX = is->getDouble("NEWX");
+		GrMaskEndY = is->getDouble("NEWY");
+	}
+}
+
+void PageItem::restoreGradientMaskFocal(SimpleState *is, bool isUndo)
 {
 	if (isUndo)
-		GrMaskEndX = is->getDouble("OLD");
-	else
-		GrMaskEndX = is->getDouble("NEW");
-}
-
-void PageItem::restoreGradientMaskEndY(SimpleState *is, bool isUndo)
-{
-	if (isUndo)
-		GrMaskEndY= is->getDouble("OLD");
-	else
-		GrMaskEndY = is->getDouble("NEW");
-}
-
-void PageItem::restoreGradientMaskFocalX(SimpleState *is, bool isUndo)
-{
-	if (isUndo)
-		GrMaskFocalX= is->getDouble("OLD");
-	else
-		GrMaskFocalX = is->getDouble("NEW");
-}
-
-void PageItem::restoreGradientMaskFocalY(SimpleState *is, bool isUndo)
-{
-	if (isUndo)
-		GrMaskFocalY= is->getDouble("OLD");
-	else
-		GrMaskFocalY = is->getDouble("NEW");
+	{
+		GrMaskFocalX = is->getDouble("OLDX");
+		GrMaskFocalY = is->getDouble("OLDY");
+	}
+	else
+	{
+		GrMaskFocalX = is->getDouble("NEWX");
+		GrMaskFocalY = is->getDouble("NEWY");
+	}
 }
 
 void PageItem::restoreGradientMaskScale(SimpleState *is, bool isUndo)
@@ -6410,52 +6374,46 @@
 		GrStrokeSkew = is->getDouble("NEW");
 }
 
-void PageItem::restoreGradientStrokeFocalX(SimpleState *is, bool isUndo)
+void PageItem::restoreGradientStrokeFocal(SimpleState *is, bool isUndo)
 {
 	if (isUndo)
-		GrStrokeFocalX = is->getDouble("OLD");
-	else
-		GrStrokeFocalX = is->getDouble("NEW");
-}
-
-void PageItem::restoreGradientStrokeFocalY(SimpleState *is, bool isUndo)
+	{
+		GrStrokeFocalX = is->getDouble("OLDX");
+		GrStrokeFocalY = is->getDouble("OLDY");
+	}
+	else
+	{
+		GrStrokeFocalX = is->getDouble("NEWX");
+		GrStrokeFocalY = is->getDouble("NEWY");
+	}
+}
+
+void PageItem::restoreGradientStrokeStart(SimpleState *is, bool isUndo)
 {
 	if (isUndo)
-		GrStrokeFocalY = is->getDouble("OLD");
-	else
-		GrStrokeFocalY = is->getDouble("NEW");
-}
-
-void PageItem::restoreGradientStrokeStartX(SimpleState *is, bool isUndo)
+	{
+		GrStrokeStartX = is->getDouble("OLDX");
+		GrStrokeStartY = is->getDouble("OLDY");
+	}
+	else
+	{
+		GrStrokeStartX = is->getDouble("NEWX");
+		GrStrokeStartY = is->getDouble("NEWY");
+	}
+}
+
+void PageItem::restoreGradientStrokeEnd(SimpleState *is, bool isUndo)
 {
 	if (isUndo)
-		GrStrokeStartX = is->getDouble("OLD");
-	else
-		GrStrokeStartX = is->getDouble("NEW");
-}
-
-void PageItem::restoreGradientStrokeStartY(SimpleState *is, bool isUndo)
-{
-	if (isUndo)
-		GrStrokeStartY = is->getDouble("OLD");
-	else
-		GrStrokeStartY = is->getDouble("NEW");
-}
-
-void PageItem::restoreGradientStrokeEndX(SimpleState *is, bool isUndo)
-{
-	if (isUndo)
-		GrStrokeEndX = is->getDouble("OLD");
-	else
-		GrStrokeEndX = is->getDouble("NEW");
-}
-
-void PageItem::restoreGradientStrokeEndY(SimpleState *is, bool isUndo)
-{
-	if (isUndo)
-		GrStrokeEndY= is->getDouble("OLD");
-	else
-		GrStrokeEndY = is->getDouble("NEW");
+	{
+		GrStrokeEndX = is->getDouble("OLDX");
+		GrStrokeEndY = is->getDouble("OLDY");
+	}
+	else
+	{
+		GrStrokeEndX = is->getDouble("NEWX");
+		GrStrokeEndY = is->getDouble("NEWY");
+	}
 }
 
 void PageItem::restoreGradientType(SimpleState *is, bool isUndo)
@@ -8309,94 +8267,58 @@
 	GrSkew = val;
 }
 
-void PageItem::setGradientMaskStartX(double val)
-{
-	if (GrMaskStartX == val)
+void PageItem::setGradientMaskStart(double x, double y)
+{
+	if ((GrMaskStartX == x) && (GrMaskStartY == y))
 		return;
 	if (UndoManager::undoEnabled())
 	{
 		SimpleState *ss = new SimpleState(Um::GradPos, QString(), Um::IFill);
-		ss->set("GRAD_MASKSTARTX");
-		ss->set("OLD", GrMaskStartX);
-		ss->set("NEW", val);
+		ss->set("GRAD_MASKSTART");
+		ss->set("OLDX", GrMaskStartX);
+		ss->set("OLDY", GrMaskStartY);
+		ss->set("NEWX", x);
+		ss->set("NEWY", y);
 		undoManager->action(this, ss);
 	}
-	GrMaskStartX = val;
-}
-
-void PageItem::setGradientMaskStartY(double val)
-{
-	if (GrMaskStartY == val)
+	GrMaskStartX = x;
+	GrMaskStartY = y;
+}
+
+void PageItem::setGradientMaskEnd(double x, double y)
+{
+	if ((GrMaskEndX == x) && (GrMaskEndY == y))
 		return;
 	if (UndoManager::undoEnabled())
 	{
 		SimpleState *ss = new SimpleState(Um::GradPos, QString(), Um::IFill);
-		ss->set("GRAD_MASKSTARTY");
-		ss->set("OLD", GrMaskStartY);
-		ss->set("NEW", val);
+		ss->set("GRAD_MASKEND");
+		ss->set("OLDX", GrMaskEndX);
+		ss->set("OLDY", GrMaskEndY);
+		ss->set("NEWX", x);
+		ss->set("NEWY", y);
 		undoManager->action(this, ss);
 	}
-	GrMaskStartY = val;
-}
-
-void PageItem::setGradientMaskEndX(double val)
-{
-	if (GrMaskEndX == val)
+	GrMaskEndX = x;
+	GrMaskEndY = y;
+}
+
+void PageItem::setGradientMaskFocal(double x, double y)
+{
+	if ((GrMaskFocalX == x) && (GrMaskFocalY == y))
 		return;
 	if (UndoManager::undoEnabled())
 	{
 		SimpleState *ss = new SimpleState(Um::GradPos, QString(), Um::IFill);
-		ss->set("GRAD_MASKENDX");
-		ss->set("OLD", GrMaskEndX);
-		ss->set("NEW", val);
+		ss->set("GRAD_MASKFOCAL");
+		ss->set("OLDX", GrMaskFocalX);
+		ss->set("OLDY", GrMaskFocalY);
+		ss->set("NEWX", x);
+		ss->set("NEWY", y);
 		undoManager->action(this, ss);
 	}
-	GrMaskEndX = val;
-}
-
-void PageItem::setGradientMaskEndY(double val)
-{
-	if (GrMaskEndY==val)
-		return;
-	if (UndoManager::undoEnabled())
-	{
-		SimpleState *ss = new SimpleState(Um::GradPos, QString(), Um::IFill);
-		ss->set("GRAD_MASKENDY");
-		ss->set("OLD", GrMaskEndY);
-		ss->set("NEW", val);
-		undoManager->action(this, ss);
-	}
-	GrMaskEndY = val;
-}
-
-void PageItem::setGradientMaskFocalX(double val)
-{
-	if (GrMaskFocalX == val)
-		return;
-	if (UndoManager::undoEnabled())
-	{
-		SimpleState *ss = new SimpleState(Um::GradPos, QString(), Um::IFill);
-		ss->set("GRAD_MASKFOCALX");
-		ss->set("OLD", GrMaskFocalX);
-		ss->set("NEW", val);
-		undoManager->action(this, ss);
-	}
-	GrMaskFocalX = val;
-}
-
-void PageItem::setGradientMaskFocalY(double val)
-{
-	if (GrMaskFocalY == val)
-		return;
-	if (UndoManager::undoEnabled())
-	{
-		SimpleState *ss = new SimpleState(Um::GradPos, QString(), Um::IFill);
-		ss->set("GRAD_MASKFOCALY");
-		ss->set("OLD", GrMaskFocalY);
-		ss->set("NEW", val);
-		undoManager->action(this, ss);
-	}
-	GrMaskFocalY = val;
+	GrMaskFocalX = x;
+	GrMaskFocalY = y;
 }
 
 void PageItem::setGradientMaskScale(double val)
@@ -8529,94 +8451,58 @@
 	GrStrokeSkew = val;
 }
 
-void PageItem::setGradientStrokeFocalX(double val)
-{
-	if (GrStrokeFocalX==val)
+void PageItem::setGradientStrokeFocal(double x, double y)
+{
+	if ((GrStrokeFocalX == x) & (GrStrokeFocalY == y))
 		return;
 	if (UndoManager::undoEnabled())
 	{
 		SimpleState *ss = new SimpleState(Um::GradPos,"",Um::ILine);
-		ss->set("GRADSTROKE_FOCALX");
-		ss->set("OLD", GrStrokeFocalX);
-		ss->set("NEW", val);
+		ss->set("GRADSTROKE_FOCAL");
+		ss->set("OLDX", GrStrokeFocalX);
+		ss->set("OLDY", GrStrokeFocalY);
+		ss->set("NEWX", x);
+		ss->set("NEWY", y);
 		undoManager->action(this, ss);
 	}
-	GrStrokeFocalX = val;
-}
-
-void PageItem::setGradientStrokeFocalY(double val)
-{
-	if (GrStrokeFocalY==val)
+	GrStrokeFocalX = x;
+	GrStrokeFocalY = y;
+}
+
+void PageItem::setGradientStrokeStart(double x, double y)
+{
+	if ((GrStrokeStartX == x) && (GrStrokeStartY == y))
 		return;
 	if (UndoManager::undoEnabled())
 	{
 		SimpleState *ss = new SimpleState(Um::GradPos,"",Um::ILine);
-		ss->set("GRADSTROKE_FOCALY");
-		ss->set("OLD", GrStrokeFocalY);
-		ss->set("NEW", val);
+		ss->set("GRADSTROKE_START");
+		ss->set("OLDX", GrStrokeStartX);
+		ss->set("OLDY", GrStrokeStartY);
+		ss->set("NEWX", x);
+		ss->set("NEWY", y);
 		undoManager->action(this, ss);
 	}
-	GrStrokeFocalY = val;
-}
-
-void PageItem::setGradientStrokeStartX(double val)
-{
-	if (GrStrokeStartX==val)
+	GrStrokeStartX = x;
+	GrStrokeStartY = y;
+}
+
+void PageItem::setGradientStrokeEnd(double x, double y)
+{
+	if ((GrStrokeEndX == x) && (GrStrokeEndY == y))
 		return;
 	if (UndoManager::undoEnabled())
 	{
 		SimpleState *ss = new SimpleState(Um::GradPos,"",Um::ILine);
-		ss->set("GRADSTROKE_STARTX");
-		ss->set("OLD", GrStrokeStartX);
-		ss->set("NEW", val);
+		ss->set("GRADSTROKE_END");
+		ss->set("OLDX", GrStrokeEndX);
+		ss->set("OLDY", GrStrokeEndY);
+		ss->set("NEWX", x);
+		ss->set("NEWY", y);
 		undoManager->action(this, ss);
 	}
-	GrStrokeStartX = val;
-}
-
-void PageItem::setGradientStrokeStartY(double val)
-{
-	if (GrStrokeStartY==val)
-		return;
-	if (UndoManager::undoEnabled())
-	{
-		SimpleState *ss = new SimpleState(Um::GradPos,"",Um::ILine);
-		ss->set("GRADSTROKE_STARTY");
-		ss->set("OLD", GrStrokeStartY);
-		ss->set("NEW", val);
-		undoManager->action(this, ss);
-	}
-	GrStrokeStartY = val;
-}
-
-void PageItem::setGradientStrokeEndX(double val)
-{
-	if (GrStrokeEndX==val)
-		return;
-	if (UndoManager::undoEnabled())
-	{
-		SimpleState *ss = new SimpleState(Um::GradPos,"",Um::ILine);
-		ss->set("GRADSTROKE_ENDX");
-		ss->set("OLD", GrStrokeEndX);
-		ss->set("NEW", val);
-		undoManager->action(this, ss);
-	}
-	GrStrokeEndX = val;
-}
-
-void PageItem::setGradientStrokeEndY(double val)
-{
-	if (GrStrokeEndY==val)
-		return;
-	if (UndoManager::undoEnabled())
-	{
-		SimpleState *ss = new SimpleState(Um::GradPos,"",Um::ILine);
-		ss->set("GRADSTROKE_ENDY");
-		ss->set("OLD", GrStrokeEndY);
-		ss->set("NEW", val);
-		undoManager->action(this, ss);
-	}
-	GrStrokeEndY = val;
+	GrStrokeEndX = x;
+	GrStrokeEndY = y;
 }
 
 void PageItem::getNamedResources(ResourceCollection& lists) const

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23109&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h	(original)
+++ trunk/Scribus/scribus/pageitem.h	Tue Aug  6 05:14:09 2019
@@ -546,39 +546,39 @@
 	void setGradientType(int val);
 
 	QPointF gradientStart() const { return QPointF(GrStartX, GrStartY); }
-	void setGradientStart(double x, double y);
 	double gradientStartX() const { return GrStartX; }
 	double gradientStartY() const { return GrStartY; }
+	void setGradientStart(double x, double y);
 
 	QPointF gradientEnd() const { return QPointF(GrEndX, GrEndY); }
-	void setGradientEnd(double x, double y);
 	double gradientEndX() const { return GrEndX; }
 	double gradientEndY() const { return GrEndY; }
+	void setGradientEnd(double x, double y);
 
 	QPointF gradientFocal() const { return QPointF(GrFocalX, GrFocalY); }
-	void setGradientFocal(double x, double y);
 	double gradientFocalX() const { return GrFocalX; }
 	double gradientFocalY() const { return GrFocalY; }
+	void setGradientFocal(double x, double y);
 
 	double gradientScale() const { return GrScale; }
 	void setGradientScale(double val);
 	double gradientSkew() const { return GrSkew; }
 	void setGradientSkew(double val);
 
-	double gradientMaskStartX() const { return GrMaskStartX; }
-	void setGradientMaskStartX(double val);
-	double gradientMaskStartY() const { return GrMaskStartY; }
-	void setGradientMaskStartY(double val);
-
+	QPointF gradientMaskStart() const { return QPointF(GrMaskStartX, GrMaskStartY); }
+	double  gradientMaskStartX() const { return GrMaskStartX; }
+	double  gradientMaskStartY() const { return GrMaskStartY; }
+	void setGradientMaskStart(double x, double y);
+
+	QPointF gradientMaskEnd() const { return QPointF(GrMaskEndX, GrMaskEndY); }
 	double gradientMaskEndX() const { return GrMaskEndX; }
-	void setGradientMaskEndX(double val);
 	double gradientMaskEndY() const { return GrMaskEndY; }
-	void setGradientMaskEndY(double val);
-
+	void setGradientMaskEnd(double x, double y);
+
+	QPointF gradientMaskFocal() const { return QPointF(GrMaskFocalX, GrMaskFocalY); }
 	double gradientMaskFocalX() const { return GrMaskFocalX; }
-	void setGradientMaskFocalX(double val);
 	double gradientMaskFocalY() const { return GrMaskFocalY; }
-	void setGradientMaskFocalY(double val);
+	void setGradientMaskFocal(double x, double y);
 
 	double gradientMaskScale() const { return GrMaskScale; }
 	void setGradientMaskScale(double val);
@@ -601,19 +601,20 @@
 	double gradientStrokeSkew() const { return GrStrokeSkew; }
 	void setGradientStrokeSkew(double val);
 
+	QPointF gradientStrokeFocal() const { return QPointF(GrStrokeFocalX, GrStrokeFocalY); }
 	double gradientStrokeFocalX() const { return GrStrokeFocalX; }
-	void setGradientStrokeFocalX(double val);
 	double gradientStrokeFocalY() const { return GrStrokeFocalY; }
-	void setGradientStrokeFocalY(double val);
+	void setGradientStrokeFocal(double x, double y);
+
+	QPointF gradientStrokeStart() const { return QPointF(GrStrokeStartX, GrStrokeStartY); }
 	double gradientStrokeStartX() const { return GrStrokeStartX; }
-	void setGradientStrokeStartX(double val);
 	double gradientStrokeStartY() const { return GrStrokeStartY; }
-	void setGradientStrokeStartY(double val);
-
+	void setGradientStrokeStart(double x, double y);
+
+	QPointF gradientStrokeEnd() const { return QPointF(GrStrokeEndX, GrStrokeEndY); }
 	double gradientStrokeEndX() const { return GrStrokeEndX; }
-	void setGradientStrokeEndX(double val);
 	double gradientStrokeEndY() const { return GrStrokeEndY; }
-	void setGradientStrokeEndY(double val);
+	void setGradientStrokeEnd(double x, double y);
 
 	QString gradientCol1() const { return GrColorP1; }
 	void setGradientCol1(const QString& val);
@@ -1574,14 +1575,11 @@
 	void restoreGradientControl5(SimpleState *state, bool isUndo);
 	void restoreGradientEnd(SimpleState *state, bool isUndo);
 	void restoreGradientFocal(SimpleState *state, bool isUndo);
-	void restoreGradientMaskEndX(SimpleState *state, bool isUndo);
-	void restoreGradientMaskEndY(SimpleState *state, bool isUndo);
-	void restoreGradientMaskFocalX(SimpleState *state, bool isUndo);
-	void restoreGradientMaskFocalY(SimpleState *state, bool isUndo);
+	void restoreGradientMaskEnd(SimpleState *state, bool isUndo);
+	void restoreGradientMaskFocal(SimpleState *state, bool isUndo);
 	void restoreGradientMaskScale(SimpleState *state, bool isUndo);
 	void restoreGradientMaskSkew(SimpleState *state, bool isUndo);
-	void restoreGradientMaskStartX(SimpleState *state, bool isUndo);
-	void restoreGradientMaskStartY(SimpleState *state, bool isUndo);
+	void restoreGradientMaskStart(SimpleState *state, bool isUndo);
 	void restoreGradientMeshColor(SimpleState *state, bool isUndo);
 	void restoreGradientScale(SimpleState *state, bool isUndo);
 	void restoreGradientShade1(SimpleState *state, bool isUndo);
@@ -1590,14 +1588,11 @@
 	void restoreGradientShade4(SimpleState *state, bool isUndo);
 	void restoreGradientSkew(SimpleState *state, bool isUndo);
 	void restoreGradientStart(SimpleState *state, bool isUndo);
-	void restoreGradientStrokeEndX(SimpleState *state, bool isUndo);
-	void restoreGradientStrokeEndY(SimpleState *state, bool isUndo);
-	void restoreGradientStrokeFocalX(SimpleState *state, bool isUndo);
-	void restoreGradientStrokeFocalY(SimpleState *state, bool isUndo);
+	void restoreGradientStrokeEnd(SimpleState *state, bool isUndo);
+	void restoreGradientStrokeFocal(SimpleState *state, bool isUndo);
 	void restoreGradientStrokeScale(SimpleState *state, bool isUndo);
 	void restoreGradientStrokeSkew(SimpleState *state, bool isUndo);
-	void restoreGradientStrokeStartX(SimpleState *state, bool isUndo);
-	void restoreGradientStrokeStartY(SimpleState *state, bool isUndo);
+	void restoreGradientStrokeStart(SimpleState *state, bool isUndo);
 	void restoreGradientTrans1(SimpleState *state, bool isUndo);
 	void restoreGradientTrans2(SimpleState *state, bool isUndo);
 	void restoreGradientTrans3(SimpleState *state, bool isUndo);

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23109&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp	Tue Aug  6 05:14:09 2019
@@ -648,18 +648,14 @@
 			trans = undoManager->beginTransaction(Um::Selection, Um::ILine, Um::GradPos + "p", "", Um::ILine);
 		if (m_ScMW->view->editStrokeGradient == 1)
 		{
-			m_item->setGradientStrokeStartX(x1 / m_unitRatio);
-			m_item->setGradientStrokeStartY(y1 / m_unitRatio);
-			m_item->setGradientStrokeEndX(x2 / m_unitRatio);
-			m_item->setGradientStrokeEndY(y2 / m_unitRatio);
-			m_item->setGradientStrokeFocalX(fx / m_unitRatio);
-			m_item->setGradientStrokeFocalY(fy / m_unitRatio);
+			m_item->setGradientStrokeStart(x1 / m_unitRatio, y1 / m_unitRatio);
+			m_item->setGradientStrokeEnd(x2 / m_unitRatio, y2 / m_unitRatio);
+			m_item->setGradientStrokeFocal(fx / m_unitRatio, fy / m_unitRatio);
 			m_item->setGradientStrokeScale(sg);
 			m_item->setGradientStrokeSkew(sk);
 			if (m_item->strokeGradientType() == 6)
 			{
-				m_item->setGradientStrokeFocalX(m_item->gradientStrokeStartX());
-				m_item->setGradientStrokeFocalY(m_item->gradientStrokeStartY());
+				m_item->setGradientStrokeFocal(m_item->gradientStrokeStartX(), m_item->gradientStrokeStartY());
 			}
 			m_item->update();
 			upRect = QRectF(QPointF(m_item->gradientStrokeStartX(), m_item->gradientStrokeStartY()), QPointF(m_item->gradientStrokeEndX(), m_item->gradientStrokeEndY()));
@@ -786,18 +782,14 @@
 		UndoTransaction trans;
 		if (UndoManager::undoEnabled())
 			trans = undoManager->beginTransaction(Um::Selection, Um::ILine, Um::GradPos + "o", "", Um::ILine);
-		m_item->setGradientMaskStartX(x1 / m_unitRatio);
-		m_item->setGradientMaskStartY(y1 / m_unitRatio);
-		m_item->setGradientMaskEndX(x2 / m_unitRatio);
-		m_item->setGradientMaskEndY(y2 / m_unitRatio);
-		m_item->setGradientMaskFocalX(fx / m_unitRatio);
-		m_item->setGradientMaskFocalY(fy / m_unitRatio);
+		m_item->setGradientMaskStart(x1 / m_unitRatio, y1 / m_unitRatio);
+		m_item->setGradientMaskEnd(x2 / m_unitRatio, y2 / m_unitRatio);
+		m_item->setGradientMaskFocal(fx / m_unitRatio, fy / m_unitRatio);
 		m_item->setGradientMaskScale(sg);
 		m_item->setGradientMaskSkew(sk);
 		if ((m_item->GrMask == 1) || (m_item->GrMask == 4))
 		{
-			m_item->setGradientMaskFocalX(m_item->GrMaskStartX);
-			m_item->setGradientMaskFocalY(m_item->GrMaskStartY);
+			m_item->setGradientMaskFocal(m_item->GrMaskStartX, m_item->GrMaskStartY);
 		}
 		m_item->update();
 		if (trans)




More information about the scribus-commit mailing list