Skip to content

Commit

Permalink
Merge pull request #47 from KCarlile/42-string-names-flip-ordering-wh…
Browse files Browse the repository at this point in the history
…en-toggling-orientation-via-button

Changed array copy to deep copy
  • Loading branch information
KCarlile authored Jun 12, 2024
2 parents 56f4284 + d9016c4 commit 78680ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/guitar-diagrams.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class GuitarDiagramsJS {
let stringNamesIndent = this.#config.fretStartingNumber == 0 ? 0 : fretNumberFontSize;
let posX;
let posY;
let stringNames = this.#config.stringNames;
let stringNames = [...this.#config.stringNames]; // deep copy array

// vertical draws string names left to right, but horizontal needs to draw them bottom to top
if (this.#config.orientHorizontally == true) {
Expand Down Expand Up @@ -561,13 +561,13 @@ export class GuitarDiagramsJS {
const controlClass = 'guitar-diagrams-control';
const controlClassPrefix = 'guitar-diagrams-';

let canvasElement = document.getElementById(this.#config.canvasID);
const canvasElement = document.getElementById(this.#config.canvasID);

let controlsDiv = document.createElement('div');
const controlsDiv = document.createElement('div');
controlsDiv.style = 'display: block; margin-top: .5em';
canvasElement.insertAdjacentElement('afterend', controlsDiv);

// add the controls in reverse order of display order
// add the controls in reverse order of desired display order (last to first)
// other controls go here
/*
if (this.#config.someFeatureEnabled) {
Expand Down

0 comments on commit 78680ba

Please sign in to comment.