Skip to content

Commit

Permalink
Fixed seq view paint bug
Browse files Browse the repository at this point in the history
  • Loading branch information
FangCunWuChang committed Jul 18, 2024
1 parent 5344930 commit a57cce8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ui/component/sequencer/SeqTrackContentViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ void SeqTrackContentViewer::updateBlock(int /*blockIndex*/) {
}

void SeqTrackContentViewer::updateHPos(double pos, double itemSize) {
if (this->getWidth() <= 0) { return; }

bool shouldRepaintDataImage = !juce::approximatelyEqual(this->itemSize, itemSize);

this->pos = pos;
Expand Down Expand Up @@ -206,6 +208,8 @@ void SeqTrackContentViewer::updateDataImage() {
}

void SeqTrackContentViewer::paint(juce::Graphics& g) {
if (this->getWidth() <= 0 || this->getHeight() <= 0) { return; }

/** Size */
auto screenSize = utils::getScreenSize(this);
float paddingHeight = screenSize.getHeight() * 0.0025;
Expand Down Expand Up @@ -248,6 +252,7 @@ void SeqTrackContentViewer::paint(juce::Graphics& g) {
auto paintBlockFunc = [this, &g, &blockNameFont, paddingHeight, blockRadius, outlineColor, outlineThickness,
blockPaddingWidth, blockPaddingHeight, blockNameFontHeight, dstPointPerSec, imgScaleRatio, noteMaxHeight]
(double blockStartSec, double blockEndSec, double blockOffset, float blockAlpha = 1.f) {
if (this->secStart >= this->secEnd) { return; }
float startPos = (blockStartSec - this->secStart) / (this->secEnd - this->secStart) * this->getWidth();
float endPos = (blockEndSec - this->secStart) / (this->secEnd - this->secStart) * this->getWidth();

Expand Down

0 comments on commit a57cce8

Please sign in to comment.