Initial steps for icon buttons.
This commit is contained in:
parent
8130308f7f
commit
f2ab532005
17 changed files with 66 additions and 2 deletions
|
@ -96,11 +96,17 @@ void SvgPainter::setStyle(SceneModel* model, SvgShapeElement* element) const
|
|||
if (model->hasFillColor())
|
||||
{
|
||||
element->setFill(model->getFillColor());
|
||||
auto opacity = static_cast<float>(model->getFillColor().getAlpha());
|
||||
if (opacity != 1.0)
|
||||
{
|
||||
element->setFillOpacity(opacity);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
element->setNoFill();
|
||||
}
|
||||
|
||||
if (model->hasOutlineColor())
|
||||
{
|
||||
element->setStrokeColor(model->getOutlineColor());
|
||||
|
@ -156,10 +162,18 @@ void SvgPainter::paintText(SvgDocument* document, SceneText* text) const
|
|||
{
|
||||
auto svg_text = std::make_unique<SvgTextElement>();
|
||||
svg_text->setContent(text->getTextData().mContent);
|
||||
svg_text->setLocation(text->getTransform().getLocation());
|
||||
auto loc = text->getTransform().getLocation();
|
||||
loc.move(0.0, text->getTextHeight());
|
||||
svg_text->setLocation(loc);
|
||||
|
||||
svg_text->setFontFamily(text->getTextData().mFont.getFaceName());
|
||||
svg_text->setFill(text->getFillColor());
|
||||
auto opacity = static_cast<float>(text->getFillColor().getAlpha());
|
||||
if (opacity != 1.0)
|
||||
{
|
||||
svg_text->setFillOpacity(opacity);
|
||||
}
|
||||
|
||||
svg_text->setFontSize(text->getTextData().mFont.getSize());
|
||||
|
||||
document->getRoot()->addChild(std::move(svg_text));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue