Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderLedgerLinesForNote(note, idx) {
const props = this.props
let offset = noteStaffOffset(note.note)
let outside = offset > props.upperRow || offset < props.lowerRow
if (!outside) {
return
}
let letterDelta = 0
let below = false
// above
if (offset > props.upperRow) {
letterDelta = offset - props.upperRow;
}
// below
if (offset < props.lowerRow) {
letterDelta = props.lowerRow - offset;
renderNote(note, idx, notesByColumn) {
const props = this.props
let key = props.keySignature
let noteName = key.enharmonic(note.note)
let pitch = parseNote(noteName)
let row = noteStaffOffset(noteName)
let fromTop = props.upperRow - row;
let offsetLeft = props.offsetLeft || 0
let left = offsetLeft + note.getStart() * this.props.pixelsPerBeat
let column = notesByColumn[note.getStart().toString()]
let style = {
top: `${Math.floor(fromTop * 25/2)}%`,
left: `${left}px`
}
let outside = row > props.upperRow || row < props.lowerRow
let accidentals = key.accidentalsForNote(noteName)
let noteClasses = null
let toRow = n =>
noteStaffOffset(this.props.keySignature.enharmonic(n))
{sigNotes.map((n, i) => {
let fromTop = topOffset - noteStaffOffset(n);
let style = {
top: `${Math.floor(fromTop * 25/2)}%`,
left: `${i * 20}px`
}
return <img src="{src}" style="{style}" data-note="{n}">;
})}
;
this.props.notes.forEach(note => {
if (this.props.filterPitch) {
let pitch = parseNote(note.note)
if (!this.props.filterPitch(pitch)) {
return
}
}
let row = noteStaffOffset(note.note)
if (min == null || row < min) {
min = row
}
if (max == null || row > max) {
max = row
}
})
}
renderNote(note, idx) {
const key = this.props.keySignature
let noteName = note.note
let pitch = parseNote(noteName)
let pixelsPerBeat = this.props.pixelsPerBeat
let row = noteStaffOffset(noteName)
let fromTop = this.props.upperRow - row
let fromLeft = note.getStart() * pixelsPerBeat + 2
let width = note.getRenderStop() * pixelsPerBeat - fromLeft - 4
let accidentals = key.accidentalsForNote(noteName)
let style = {
top: `${Math.floor(fromTop * 25/2)}%`,
left: `${this.props.offsetLeft + fromLeft}px`,
width: `${width}px`
}
let outsideLoop = false
if (this.props.loopLeft != null && this.props.loopRight != null) {