add interpolation

This commit is contained in:
Konstantin Käfer
2014-06-30 17:41:25 +02:00
parent 18d898fae7
commit a6f7696feb
9 changed files with 70 additions and 7 deletions

View File

@@ -34,6 +34,10 @@ public:
void add(ClassID class_id, timestamp begin, timestamp end, const PropertyValue &value) {
properties.emplace_back(class_id, begin, end, value);
}
bool hasTransitions() const {
return properties.size() > 1;
}
};
}

View File

@@ -43,6 +43,8 @@ public:
// of applied classes.
void updateClasses();
bool hasTransitions() const;
public:
std::shared_ptr<Sprite> sprite;
std::shared_ptr<StyleLayerGroup> layers;

View File

@@ -42,6 +42,8 @@ public:
void setClasses(const std::vector<std::string> &class_names, timestamp now,
const PropertyTransition &defaultTransition);
bool hasTransitions() const;
private:
// Applies all properties from a class, if they haven't been applied already.
void applyClassProperties(ClassID class_id, std::set<PropertyKey> &already_applied,

View File

@@ -13,6 +13,7 @@ public:
const PropertyTransition &defaultTransition);
void updateProperties(float z, timestamp t);
bool hasTransitions() const;
public:
std::vector<std::shared_ptr<StyleLayer>> layers;
};