Skip to content

Commit

Permalink
Reduced code duplication towards solving #3186 for power labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kjell Morgenstern authored and KjellMorgenstern committed Apr 25, 2023
1 parent 5ee3884 commit 6a1fdbe
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/items/symbolpaletteitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,6 @@ QString NetLabel::makeSvg(ViewLayer::ViewLayerID viewLayerID) {
svg += "</g>\n</svg>\n";

if (viewLayerID == ViewLayer::SchematicText) {
double rotation;

SchematicTextLayerKinPaletteItem * schemItem = nullptr;
Q_FOREACH (ItemBase * lkpi, m_layerKin) {
auto * schemLayerItem = qobject_cast<SchematicTextLayerKinPaletteItem *>(lkpi);
Expand All @@ -631,14 +629,8 @@ QString NetLabel::makeSvg(ViewLayer::ViewLayerID viewLayerID) {
}

if (schemItem != nullptr) {
QTransform chiefTransform = layerKinChief()->transform(); // assume chief already has rotation
bool isFlipped = GraphicsUtils::isFlipped(chiefTransform, rotation);
if (isFlipped) {
svg = schemItem->flipTextSvg(svg);
}
if (rotation >= 135 && rotation <= 225) {
svg = schemItem->vflip(svg, isFlipped);
}
double rotation;
svg = schemItem->getTransformedSvg(svg, rotation);
}
}

Expand Down

0 comments on commit 6a1fdbe

Please sign in to comment.