Skip to content

Commit

Permalink
fixed tablature edge-case bug occuring when lines were uneven length …
Browse files Browse the repository at this point in the history
…(longest line was sometimes truncated); refactored tabs class to use module pattern, check longest line, and, when tab line ends with a "|" place it at exact end (canvas); follow naming convention of constant all upper case and use local "alias" variable for dependency (better minimization); fixed F#7 definition;
  • Loading branch information
buzcarter committed Mar 7, 2014
1 parent 7e8a4a8 commit c98e56e
Show file tree
Hide file tree
Showing 8 changed files with 358 additions and 280 deletions.
19 changes: 19 additions & 0 deletions cpm/how-to-markup-tablature.mr-ukegeek.cpm.txt
Expand Up @@ -49,3 +49,22 @@ C|-0-----------|-0---------
G|-------------|-----------
{eot}
A pen-ny a kiss | A pen-ny a hug

{c: Mulitple Tab Staffs In One Block}

These begin/end tab block markers wrap two Staffs.
Also, note that the second groups lines are "uneven";
in this case the longest line sets final width/length.

{start_of_tab}
A----------------------------------------------0----------0---2---2--|
E---0-------0---2-------0---2---3------2---3----------3--------------|
C-------3------------------------------------------------------------|
G--------------------------------------------------------------------|

A----------2---0-----------------------------------------------------|
E---0--------------3---2---0-----------
C-----------------------------------------
G---------------
{eot}

13 changes: 8 additions & 5 deletions js/editor/ugsChordBuilder.js
Expand Up @@ -106,9 +106,10 @@ ugsChordBuilder.settings = (function() {

//'Geneva, "Lucida Sans", "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, sans-serif';
/**
* San-Serif font stack used on Canvas
* @constant FONT_STACK
* @type {String}
* San-serif font stack used when drawing text on Canvas.
* @property {String} FONT_STACK
* @final
* @constant
*/
var FONT_STACK = 'Arial, "Helvetica Neue", Helvetica, Verdana, sans-serif';

Expand Down Expand Up @@ -333,7 +334,8 @@ ugsChordBuilder.fretDots = new function() {
var index = find(dot);
if (index < 0) {
_dots.push(dot);
} else {
}
else {
_dots.splice(index, 1);
}
};
Expand Down Expand Up @@ -502,7 +504,8 @@ ugsChordBuilder.cursorCanvas = new function() {
erase(_lastPos);
if (!_imgOk || _dotCursor) {
drawDotCursor(pos);
} else {
}
else {
drawHandCursor(pos);
}
_lastPos = pos;
Expand Down
2 changes: 0 additions & 2 deletions js/editor/ugsEditorPlus.typeahead.js
Expand Up @@ -44,8 +44,6 @@ ugsEditorPlus.typeahead = function(){
var $this = $(this);

var plainText = crushText($this.text());
plainText = plainText.toLowerCase();

var href = $this.children('a').attr('href');
var key = href.toLowerCase();

Expand Down
Expand Up @@ -157,7 +157,7 @@ ukeGeeks.definitions.sopranoUkuleleGcea = [
// -------------------------------------------------------
'{define: F# frets 3 1 2 1 fingers 3 1 2 1 add: string 1 fret 1 finger 1 add: string 3 fret 1 finger 1}',
'{define: F#m frets 2 1 2 0 fingers 2 1 3 0}',
'{define: F#7 frets 3 4 2 1 fingers 3 4 2 1}',
'{define: F#7 frets 3 4 2 4 fingers 2 3 1 4}',
'{define: F#7sus4 frets 4 4 2 4 fingers 2 3 1 4}',
'{define: F#m7 frets 2 4 2 4 fingers 1 3 2 4}',
'{define: F#dim frets 2 3 2 3 fingers 1 3 2 4}',
Expand Down

0 comments on commit c98e56e

Please sign in to comment.