MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / DoOnPaint

Method DoOnPaint

Source/GraphEditorComponentImpl.cpp:303–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303void CBarGraph::DoOnPaint(CDC &dc) {
304 DrawBackground(dc, items_, false, 0);
305 DrawRange(dc, items_, 0);
306
307 auto pSeq = parent_.GetSequence();
308 if (!pSeq)
309 return;
310 int Count = pSeq->GetItemCount();
311
312 const int StepWidth = GetItemWidth();
313 const int StepHeight = GetItemHeight(); // // //
314 const int Top = GetItemTop(); // // //
315
316 if (m_iHighlightedValue > 0 && m_iHighlightedItem >= 0 && m_iHighlightedItem < Count) {
317 int x = region_.left + m_iHighlightedItem * StepWidth + 1;
318 int y = Top + StepHeight * (items_ - m_iHighlightedValue);
319 int w = StepWidth;
320 int h = StepHeight * m_iHighlightedValue;
321 DrawShadowRect(dc, x, y, w, h);
322 }
323
324 // Draw items
325 for (int i = 0; i < Count; ++i) {
326 int x = region_.left + i * StepWidth + 1;
327 int y = Top + StepHeight * (items_ - pSeq->GetItem(i));
328 int w = StepWidth;
329 int h = StepHeight * pSeq->GetItem(i);
330
331 if (parent_.GetCurrentPlayPos() == i)
332 DrawPlayRect(dc, x, y, w, h);
333 else if ((m_iHighlightedItem == i) && (pSeq->GetItem(i) >= m_iHighlightedValue))
334 DrawCursorRect(dc, x, y, w, h);
335 else
336 DrawRect(dc, x, y, w, h);
337 }
338
339 DrawLine(dc);
340}
341
342
343

Callers

nothing calls this directly

Calls 14

GREYFunction · 0.85
MakeRGBFunction · 0.85
BLENDFunction · 0.85
sizeFunction · 0.85
GetItemMethod · 0.80
GetCurrentPlayPosMethod · 0.80
GetGraphScrollOffsetMethod · 0.80
GetSettingMethod · 0.80
GetLoopPointMethod · 0.80
GetReleasePointMethod · 0.80
GetItemWidthMethod · 0.80
GetItemBottomMethod · 0.80

Tested by

no test coverage detected