Compare commits
2 Commits
6494c2b9af
...
e48954175d
Author | SHA1 | Date |
---|---|---|
yang.yongquan | e48954175d | |
yang.yongquan | 3c2eada43f |
|
@ -197,6 +197,25 @@ bool LayerStyleContainer::dropStyle(const QString& styleName)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float LayerStyleContainer::boundingBoxAffectValue() {
|
||||||
|
float maxLineWidth = 0;
|
||||||
|
auto strokeStyle = styles[StrokeElementLayerStyle::displayName()];
|
||||||
|
if (strokeStyle != nullptr) {
|
||||||
|
auto strokeElementLayerStyle = dynamic_cast<StrokeElementLayerStyle*>(strokeStyle.get());
|
||||||
|
if (strokeElementLayerStyle != nullptr) {
|
||||||
|
auto leftStyleStroke = strokeElementLayerStyle->strokePair.first;
|
||||||
|
auto rightStyleStroke = strokeElementLayerStyle->strokePair.second;
|
||||||
|
if (leftStyleStroke != nullptr) {
|
||||||
|
maxLineWidth = std::max(maxLineWidth, leftStyleStroke->halfWidth);
|
||||||
|
}
|
||||||
|
if (rightStyleStroke != nullptr) {
|
||||||
|
maxLineWidth = std::max(maxLineWidth, rightStyleStroke->halfWidth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return maxLineWidth;
|
||||||
|
}
|
||||||
|
|
||||||
inline size_t LayerStyleContainer::getHash() const
|
inline size_t LayerStyleContainer::getHash() const
|
||||||
{
|
{
|
||||||
return hash;
|
return hash;
|
||||||
|
|
|
@ -56,6 +56,7 @@ public:
|
||||||
std::unique_ptr<LayerStyle> makeUnusedStyle(const QString& styleName) const;
|
std::unique_ptr<LayerStyle> makeUnusedStyle(const QString& styleName) const;
|
||||||
bool useStyle(const std::shared_ptr<LayerStyle>& style);
|
bool useStyle(const std::shared_ptr<LayerStyle>& style);
|
||||||
bool dropStyle(const QString& styleName);
|
bool dropStyle(const QString& styleName);
|
||||||
|
float boundingBoxAffectValue();
|
||||||
size_t getHash() const;
|
size_t getHash() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue