Skip to content

Commit

Permalink
Fix to stop font_options being written to when a copy is required
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Young committed Nov 8, 2011
1 parent 9cc980d commit a2119ea
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Raphael is the only dependency.

h3. News

* [2011-11-08] 0.3.4: Added <code>bar_labels</code> option that displays values above the standard bar graphs
* [2011-11-08] 0.3.4.1: Added <code>bar_labels</code> option that displays values above the standard bar graphs
* [2011-09-30] 0.3.3: Added <code>label_step</code> and <code>label_count</code> options so numerical labels can be controlled
* [2011-08-30] 0.3.2: No longer extending native prototypes
* [2011-08-24] 0.3.1: Bug fix for LineGraph, migrated tests to QUnit, moved Jakefile.js to Makefile
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ <h2></h2>
<td class="code">
<pre><code>(<span class="keyword">function</span>(<span class="variable">global</span>) {
<span class="keyword">var</span> <span class="class">Ico</span> = {
<span class="class">VERSION</span>: <span class="string">'0.3.4'</span>,</code></pre>
<span class="class">VERSION</span>: <span class="string">'0.3.4.1'</span>,</code></pre>
</td>
</tr>
<tr class="code">
Expand Down
9 changes: 5 additions & 4 deletions ico.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
(function(global) {
var Ico = {
VERSION: '0.3.4',
VERSION: '0.3.4.1',

/**
* Rounds a float to the specified number of decimal places.
Expand Down Expand Up @@ -631,7 +631,8 @@ Helpers.extend(Ico.BaseGraph.prototype, {
y = this.options.height - this.y_padding_bottom + y_offset(start_offset),
pathString = '',
i,
font_options = this.font_options;
font_options = {};
Helpers.extend(font_options, this.font_options);
Helpers.extend(font_options, extra_font_options || {});

for (i = 0; i < labels.length; i++) {
Expand Down Expand Up @@ -747,8 +748,8 @@ Helpers.extend(Ico.BarGraph.prototype, {
return;
}

var i, length = this.flat_data.length, x, y, label, font_options;
font_options = this.font_options;
var i, length = this.flat_data.length, x, y, label, font_options = {};
Helpers.extend(font_options, this.font_options);
font_options['text-anchor'] = 'center';

for (i = 0; i < length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions src/graphs/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ Helpers.extend(Ico.BarGraph.prototype, {
return;
}

var i, length = this.flat_data.length, x, y, label, font_options;
font_options = this.font_options;
var i, length = this.flat_data.length, x, y, label, font_options = {};
Helpers.extend(font_options, this.font_options);
font_options['text-anchor'] = 'center';

for (i = 0; i < length; i++) {
Expand Down
3 changes: 2 additions & 1 deletion src/graphs/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ Helpers.extend(Ico.BaseGraph.prototype, {
y = this.options.height - this.y_padding_bottom + y_offset(start_offset),
pathString = '',
i,
font_options = this.font_options;
font_options = {};
Helpers.extend(font_options, this.font_options);
Helpers.extend(font_options, extra_font_options || {});

for (i = 0; i < labels.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
(function(global) {
var Ico = {
VERSION: '0.3.4',
VERSION: '0.3.4.1',

/**
* Rounds a float to the specified number of decimal places.
Expand Down

0 comments on commit a2119ea

Please sign in to comment.