summaryrefslogtreecommitdiffstats
path: root/src/knot-holder-entity.h
diff options
context:
space:
mode:
authorNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-06-04 10:17:00 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2019-07-15 10:35:33 +0000
commitabe7037c965055f7a10f8e2c15578d167a7f027e (patch)
treefe6c8e673dd4d4e0bce3bfa3c63a369db4557b53 /src/knot-holder-entity.h
parentCheck knot's pattern still exists before update (diff)
downloadinkscape-abe7037c965055f7a10f8e2c15578d167a7f027e.tar.gz
inkscape-abe7037c965055f7a10f8e2c15578d167a7f027e.zip
Derive pattern knots off the same subclass
Diffstat (limited to 'src/knot-holder-entity.h')
-rw-r--r--src/knot-holder-entity.h33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/knot-holder-entity.h b/src/knot-holder-entity.h
index 1aa686f65..92c4d5536 100644
--- a/src/knot-holder-entity.h
+++ b/src/knot-holder-entity.h
@@ -24,6 +24,7 @@
class SPItem;
class SPKnot;
class SPDesktop;
+class SPPattern;
class KnotHolder;
namespace Inkscape {
@@ -106,38 +107,36 @@ protected:
/* pattern manipulation */
-class PatternKnotHolderEntityXY : public KnotHolderEntity {
+class PatternKnotHolderEntity : public KnotHolderEntity {
public:
- PatternKnotHolderEntityXY(bool fill) : KnotHolderEntity(), _fill(fill) {}
+ PatternKnotHolderEntity(bool fill) : KnotHolderEntity(), _fill(fill) {}
bool knot_missing() const override;
- Geom::Point knot_get() const override;
void knot_ungrabbed(Geom::Point const &p, Geom::Point const &origin, guint state) override {};
- void knot_set(Geom::Point const &p, Geom::Point const &origin, unsigned int state) override;
-private:
+protected:
// true if the entity tracks fill, false for stroke
bool _fill;
+ SPPattern *_pattern() const;
};
-class PatternKnotHolderEntityAngle : public KnotHolderEntity {
+class PatternKnotHolderEntityXY : public PatternKnotHolderEntity {
public:
- PatternKnotHolderEntityAngle(bool fill) : KnotHolderEntity(), _fill(fill) {}
- bool knot_missing() const override;
+ PatternKnotHolderEntityXY(bool fill) : PatternKnotHolderEntity(fill) {}
Geom::Point knot_get() const override;
- void knot_ungrabbed(Geom::Point const &p, Geom::Point const &origin, guint state) override {};
void knot_set(Geom::Point const &p, Geom::Point const &origin, unsigned int state) override;
-private:
- bool _fill;
};
-class PatternKnotHolderEntityScale : public KnotHolderEntity {
+class PatternKnotHolderEntityAngle : public PatternKnotHolderEntity {
public:
- PatternKnotHolderEntityScale(bool fill) : KnotHolderEntity(), _fill(fill) {}
- bool knot_missing() const override;
+ PatternKnotHolderEntityAngle(bool fill) : PatternKnotHolderEntity(fill) {}
+ Geom::Point knot_get() const override;
+ void knot_set(Geom::Point const &p, Geom::Point const &origin, unsigned int state) override;
+};
+
+class PatternKnotHolderEntityScale : public PatternKnotHolderEntity {
+public:
+ PatternKnotHolderEntityScale(bool fill) : PatternKnotHolderEntity(fill) {}
Geom::Point knot_get() const override;
- void knot_ungrabbed(Geom::Point const &p, Geom::Point const &origin, guint state) override {};
void knot_set(Geom::Point const &p, Geom::Point const &origin, unsigned int state) override;
-private:
- bool _fill;
};
/* Filter manipulation */