Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Extract a function for setting the default face

  • Loading branch information...
commit a57c44b35e7dedbd14a6b3f4f0aa4cf53d28a266 1 parent 18e42df
@rhburrows authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/display.js
View
9 src/display.js
@@ -1,5 +1,12 @@
(function($){
+ function defaultFace() {
+ return new Face({
+ family : 'Monaco',
+ size : 14
+ });
+ }
+
function Display(width, height) {
this.canvas = document.createElement('canvas');
$(this.canvas).attr('width', '' + width + 'px');
@@ -12,7 +19,7 @@
this.context = this.canvas.getContext('2d');
this.padding = 20;
this.faces = [];
- this.defaultFace = new Face({ family : 'Monaco', size : 14 });
+ this.defaultFace = defaultFace();
applyFace(this, this.defaultFace);
// Used for line wrapping. Messy? Yes
this.lineLengths = [];
Please sign in to comment.
Something went wrong with that request. Please try again.