Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #24019: Ensure proper conversion of TremoloBar line widths (4.4.0 port) #24031

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/engraving/rendering/dev/tdraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3126,7 +3126,8 @@ void TDraw::draw(const TremoloBar* item, Painter* painter)
{
TRACE_DRAW_ITEM;
const TremoloBar::LayoutData* ldata = item->ldata();
Pen pen(item->curColor(), item->lineWidth().val(), PenStyle::SolidLine, PenCapStyle::RoundCap, PenJoinStyle::RoundJoin);
const double lw = item->absoluteFromSpatium(item->lineWidth());
Pen pen(item->curColor(), lw, PenStyle::SolidLine, PenCapStyle::RoundCap, PenJoinStyle::RoundJoin);
painter->setPen(pen);
painter->drawPolyline(ldata->polygon);
}
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/rendering/dev/tlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6305,7 +6305,7 @@ void TLayout::layoutTremoloBar(const TremoloBar* item, TremoloBar::LayoutData* l
}
ldata->polygon = polygon;

double w = item->lineWidth().val();
const double w = item->absoluteFromSpatium(item->lineWidth());
ldata->setBbox(ldata->polygon.boundingRect().adjusted(-w, -w, w, w));
}

Expand Down
3 changes: 2 additions & 1 deletion src/engraving/rendering/single/singledraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,8 @@ void SingleDraw::draw(const TremoloBar* item, Painter* painter)
{
TRACE_DRAW_ITEM;
const TremoloBar::LayoutData* ldata = item->ldata();
Pen pen(item->curColor(), item->lineWidth().val(), PenStyle::SolidLine, PenCapStyle::RoundCap, PenJoinStyle::RoundJoin);
const double lw = item->absoluteFromSpatium(item->lineWidth());
Pen pen(item->curColor(), lw, PenStyle::SolidLine, PenCapStyle::RoundCap, PenJoinStyle::RoundJoin);
painter->setPen(pen);
painter->drawPolyline(ldata->polygon);
}
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/rendering/single/singlelayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ void SingleLayout::layout(TremoloBar* item, const Context&)
}
ldata->polygon = polygon;

double w = item->lineWidth().val();
const double w = item->absoluteFromSpatium(item->lineWidth());
ldata->setBbox(ldata->polygon.boundingRect().adjusted(-w, -w, w, w));
}

Expand Down
3 changes: 2 additions & 1 deletion src/engraving/rendering/stable/tdraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3026,7 +3026,8 @@ void TDraw::draw(const TremoloBar* item, Painter* painter)
{
TRACE_DRAW_ITEM;
const TremoloBar::LayoutData* ldata = item->ldata();
Pen pen(item->curColor(), item->lineWidth().val(), PenStyle::SolidLine, PenCapStyle::RoundCap, PenJoinStyle::RoundJoin);
const double lw = item->absoluteFromSpatium(item->lineWidth());
Pen pen(item->curColor(), lw, PenStyle::SolidLine, PenCapStyle::RoundCap, PenJoinStyle::RoundJoin);
painter->setPen(pen);
painter->drawPolyline(ldata->polygon);
}
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/rendering/stable/tlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6073,7 +6073,7 @@ void TLayout::layoutTremoloBar(const TremoloBar* item, TremoloBar::LayoutData* l
}
ldata->polygon = polygon;

double w = item->lineWidth().val();
const double w = item->absoluteFromSpatium(item->lineWidth());
ldata->setBbox(ldata->polygon.boundingRect().adjusted(-w, -w, w, w));
}

Expand Down