Initial steps for icon buttons.

This commit is contained in:
jmsgrogan 2023-01-18 20:25:13 +00:00
parent 8130308f7f
commit f2ab532005
17 changed files with 66 additions and 2 deletions

View file

@ -34,6 +34,8 @@ list(APPEND visual_elements_LIB_INCLUDES
svg/elements/SvgShapeElements.cpp
nodes/MaterialNode.h
nodes/MaterialNode.cpp
nodes/ImageNode.h
nodes/ImageNode.cpp
nodes/MeshNode.h
nodes/MeshNode.cpp
nodes/TextNode.h

View file

@ -130,7 +130,13 @@ void SvgShapeElement::setStrokeWidth(double width)
{
auto attr = std::make_unique<XmlAttribute>("stroke-width");
attr->setValue(std::to_string(width));
addAttribute(std::move(attr));
}
void SvgShapeElement::setFillOpacity(float opacity)
{
auto attr = std::make_unique<XmlAttribute>("fill-opacity");
attr->setValue(std::to_string(opacity));
addAttribute(std::move(attr));
}

View file

@ -17,6 +17,8 @@ public:
void setNoFill();
void setFillOpacity(float opacity);
void setStrokeWidth(double width);
void setStrokeColor(const Color& stroke);

View file

@ -10,6 +10,13 @@ SvgTextElement::SvgTextElement()
}
void SvgTextElement::setFillOpacity(float opacity)
{
auto attr = std::make_unique<XmlAttribute>("fill-opacity");
attr->setValue(std::to_string(opacity));
addAttribute(std::move(attr));
}
void SvgTextElement::setLocation(const Point& loc)
{
auto x = std::make_unique<XmlAttribute>("x");

View file

@ -15,6 +15,8 @@ public:
void setFill(const Color& fill);
void setFillOpacity(float opacity);
void setFontFamily(const std::string& family);
void setFontSize(float size);