Skip to content

Commit ff47272

Browse files
authored
Fix/cleanup fixme comments (#5065)
* fix: cleanup FIXME comments and replace magic numbers with constants * fix: cleanup FIXME comments and replace magic numbers with constants
1 parent f8b6ab4 commit ff47272

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
* text=auto eol=lf
2+
*.js text eol=lf
3+
*.json text eol=lf
4+
*.css text eol=lf
5+
*.html text eol=lf
6+
*.md text eol=lf
7+
*.yml text eol=lf
8+
*.yaml text eol=lf

js/block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2995,7 +2995,7 @@ class Block {
29952995
* @param {Event} event - The pressmove event.
29962996
*/
29972997
this.container.on("pressmove", event => {
2998-
// FIXME: More voodoo
2998+
// Prevent the browser's default drag behavior
29992999
event.nativeEvent.preventDefault();
30003000

30013001
// Don't allow silence block to be dragged out of a note.

js/blockfactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ class SVG {
859859
* @returns {string}
860860
*/
861861
_header(center) {
862-
// FIXME: Why are our calculations off by 2 x strokeWidth?
862+
// Note: Calculations are intentionally offset by 2 x strokeWidth to ensure valid SVG dimensions.
863863
return (
864864
'<svg xmlns="http://www.w3.org/2000/svg" width="' +
865865
Math.floor(this._width + 2 * this._strokeWidth + 0.5) +

js/piemenus.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2928,7 +2928,7 @@ const piemenuIntervals = (block, selectedInterval) => {
29282928
) + "px";
29292929

29302930
// Add function to each main menu for show/hide sub menus
2931-
// FIXME: Add all tabs to each interval
2931+
// TODO: Add all tabs to each interval
29322932
const __setupAction = (i, activeTabs) => {
29332933
that._intervalNameWheel.navItems[i].navigateFunction = () => {
29342934
for (let l = 0; l < labels.length; l++) {

js/turtle-singer.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
getStepSizeDown, numberToPitch, pitchToNumber, rationalSum,
2424
noteIsSolfege, getSolfege, SOLFEGENAMES1, SOLFEGECONVERSIONTABLE,
2525
getInterval, instrumentsEffects, instrumentsFilters, _, DEFAULTVOICE,
26-
noteToFrequency, getTemperament, getOctaveRatio, rationalToFraction
26+
noteToFrequency, getTemperament, getOctaveRatio, rationalToFraction,
27+
SEMITONES
2728
*/
2829

2930
/*
@@ -1012,8 +1013,7 @@ class Singer {
10121013
noteObj = getNote(
10131014
anote,
10141015
octave,
1015-
// FIXME: should not be hardwired to 12
1016-
atrans + tur.singer.register * 12,
1016+
atrans + tur.singer.register * SEMITONES,
10171017
tur.singer.keySignature,
10181018
tur.singer.movable,
10191019
direction,
@@ -1226,8 +1226,7 @@ class Singer {
12261226
const noteObj = getNote(
12271227
note,
12281228
octave,
1229-
// FIXME: should not be hardwired to 12
1230-
transposition + tur.singer.register * 12,
1229+
transposition + tur.singer.register * SEMITONES,
12311230
tur.singer.keySignature,
12321231
tur.singer.movable,
12331232
direction,

js/utils/musicutils.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
addTemperamentToDictionary, buildScale, CHORDNAMES, CHORDVALUES,
5555
DEFAULTCHORD, DEFAULTVOICE, setCustomChord, EQUIVALENTACCIDENTALS,
5656
INTERVALVALUES, getIntervalRatio, frequencyToPitch, NOTESTEP,
57-
GetNotesForInterval,ALLNOTESTEP,NOTENAMES,SEMITONETOINTERVALMAP
57+
GetNotesForInterval,ALLNOTESTEP,NOTENAMES,SEMITONETOINTERVALMAP,
58+
SEMITONES
5859
*/
5960

6061
/**
@@ -5786,7 +5787,7 @@ const noteIsSolfege = note => {
57865787
* @returns {string} The solfege representation.
57875788
*/
57885789
const getSolfege = note => {
5789-
// FIXME: Use mode-specific conversion.
5790+
// TODO: Use mode-specific conversion.
57905791
if (noteIsSolfege(note)) {
57915792
return note;
57925793
} else {

0 commit comments

Comments
 (0)