MCPcopy Create free account
hub / github.com/audacity/audacity / DoGetRectangle

Method DoGetRectangle

src/AdornedRulerPanel.cpp:553–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551}
552
553std::pair<wxRect, bool>
554AdornedRulerPanel::ScrubbingRulerOverlay::DoGetRectangle(wxSize /*size*/)
555{
556 Update();
557
558 const auto x = mOldQPIndicatorPos;
559 if (x >= 0) {
560 // These dimensions are always sufficient, even if a little
561 // excessive for the small triangle:
562 const int width = IndicatorBigWidth() * 3 / 2;
563 //const auto height = IndicatorHeightForWidth(width);
564
565 const int indsize = width / 2;
566
567 auto xx = x - indsize;
568 auto yy = 0;
569 return {
570 { xx, yy,
571 indsize * 2 + 1,
572 GetRuler()->GetSize().GetHeight() },
573 (x != mNewQPIndicatorPos
574 || (mOldScrub != mNewScrub)
575 || (mOldSeek != mNewSeek) )
576 };
577 }
578 else
579 return { {}, mNewQPIndicatorPos >= 0 };
580}
581
582void AdornedRulerPanel::ScrubbingRulerOverlay::Draw(
583 OverlayPanel & /*panel*/, wxDC &dc)

Callers

nothing calls this directly

Calls 5

IndicatorBigWidthFunction · 0.85
GetRulerFunction · 0.85
GetHeightMethod · 0.80
UpdateFunction · 0.50
GetSizeMethod · 0.45

Tested by

no test coverage detected