~ubuntu-branches/ubuntu/oneiric/mozgest/oneiric

« back to all changes in this revision

Viewing changes to chrome/content/sidebar/drawgesture.js

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2009-11-15 17:16:10 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20091115171610-vkkgtv4pgo4n9wo6
Tags: 3.0.0-1ubuntu1
* Merge from Debian unstable.
  - Drop debian/patches/no-dialog-on-first-startup.patch
* Rename transitional package from mozilla-mozgest to mozgest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 * ***** END LICENSE BLOCK ***** */
37
37
 
38
38
// Configurable variables
39
 
var SIZE = 32, STROKE = 1, PADDING = 4, DOTSIZE = 5, COLOR = "#000000";
 
39
var SIZE = 32, STROKE = 1, PADDING = 4, DOTSIZE = 5, COLOR = "#000000", BACKCOLOR = "#FFFFFF";
40
40
 
41
41
var strokeLength, centerX, centerY;
42
42
 
104
104
function draw(aCanvas, aGesture) {
105
105
  dummy(aCanvas);
106
106
 
 
107
  aCanvas.setColor(COLOR);
 
108
  aCanvas.setStroke(STROKE);
 
109
  aCanvas.beginPath();
 
110
 
107
111
  if (aGesture.charAt(0) == ":")
108
112
    drawRockerGesture(aCanvas, aGesture);
109
113
  else
176
180
  }
177
181
  aCanvas.beginPath();
178
182
 
 
183
  var lposx, lposy
179
184
  for (var i=0; i < positions.length - 1; ++i) {
180
185
    aCanvas.drawLine(positions[i].x + xOffset,
181
186
                     positions[i].y + yOffset,
241
246
 
242
247
function drawWheel(aCanvas, x, y, button) {
243
248
  var f = (button == "-") ? -1 : 1;
 
249
  aCanvas.beginPath();
244
250
  aCanvas.fillCircle(x + 4, y + 8, 5);
245
251
  aCanvas.fillRect(x + 8, y + 4, 1, 9);
246
252
  aCanvas.fillRect(x + 8, y + 8 + (6 * f), 1, 1);
296
302
    aCanvas.ctx.fillRect(x, y, w, h);
297
303
  };
298
304
 
 
305
  aCanvas.clearRect = function(x, y, w, h) {
 
306
    aCanvas.ctx.clearRect(x, y, w, h);
 
307
  };
 
308
 
299
309
  aCanvas.setStroke = function(width) {
300
310
    aCanvas.ctx.lineWidth = width;
301
311
  };