background, height, width # already defined!
486555
def window_xy x,y
      s = ""
      s << "+" if x > 0
      s << x.to_s
      s << "+" if y > 0
      s << y.to_s
      @root.geometry s
    end
202816
def pattern(name, x, y, width, height)
      push('defs')
      push("pattern #{name} #{x} #{y} #{width} #{height}")
      push('graphic-context')
      yield
    ensure
      pop('graphic-context')
      pop('pattern')
      pop('defs')
    end
454121
function Canvas(width, height, buffer) {
    width  = _.defaults(width , 640)|0;
    height = _.defaults(height, 400)|0;

    if (Canvas.isCanvasRGB(width, height, buffer)) {
      return new CanvasRGB(width, height, buffer);
    }
    if (Canvas.isCanvasRGBA(width, height, buffer)) {
      return new CanvasRGBA(width, height, buffer);
    }

    var $ = dollar(width, height, 1, buffer);

    $.putPixel = function(x, y, color) {
      var index = y * width + x;

      if ($.mask && $.mask[index] === 0) {
        return;
      }

      var colorIndex = color.valueOf(x, y);

      if (colorIndex !== -1) {
        $.data[index] = colorIndex & 15;
      }
    };

    this.$ = $;
  }
1076455
def size(self, width=None, height=None):
        '''
        info = CONSOLE_SCREEN_BUFFER_INFO()
        status = self.GetConsoleScreenBufferInfo(self.hout, byref(info))
        if not status:
            return None
        if width is not None and height is not None:
            wmin = info.srWindow.Right - info.srWindow.Left + 1
            hmin = info.srWindow.Bottom - info.srWindow.Top + 1
            #print wmin, hmin
            width = max(width, wmin)
            height = max(height, hmin)
            #print width, height
            self.SetConsoleScreenBufferSize(self.hout, 
                                            self.fixcoord(width, height))
        else:
            return (info.dwSize.X, info.dwSize.Y)
184960
function getBackgroundSize(image) {
	var x = image.properties.width / image.ratio;
	var y = image.properties.height / image.ratio;
	var template = _.template('<%= x %>px <%= y %>px');

	return template({x: x, y: y});
}
269942
function() {
        // viewport width and height
        var w = me.game.viewport.width;
        var h = me.game.viewport.height;

        // add the Background
        var background = game.texture.createSpriteFromName("background");
        // set position to the middle of the viewport
        // (as the sprite anchorPoint is (0.5, 0.5)
        background.pos.set(w / 2, h / 2, 1);
        // add to the scene
        me.game.world.addChild(background, 1);

        // add the Cap Guy
        var CapGuyEntity = new game.CapGuyEntity();
        // add it to the scene
        me.game.world.addChild(CapGuyEntity, 2);
    }
237793
function(width, height) {
        var gutter = (this.options.gutter * 2),
            wWidth = $(window).width() - gutter,
            wHeight = $(window).height() - gutter,
            ratio,
            diff;

        // Resize if the width is larger
        if (width > wWidth) {
            ratio = (width / height);
            diff = (width - wWidth);

            width = wWidth;
            height -= Math.round(diff / ratio);
        }

        // Resize again if the height is larger
        if (height > wHeight) {
            ratio = (height / width);
            diff = (height - wHeight);

            width -= Math.round(diff / ratio);
            height = wHeight;
        }

        this.items.css({
            width: width,
            height: height
        });
    }
669753
function (width, height) {
        this._lightAccumTex.width = width;
        this._lightAccumTex.height = height;

        // PENDING viewport ?
        this._gBuffer.resize(width, height);
    }
1366661
def set_size(self, w, h):
        
        self.attributes['width'] = str(w)
        self.attributes['height'] = str(h)
76140
function(r) {
			geo.origin.size.height = r.height,
				geo.origin.windowOffset.left = r.left,
				geo.origin.windowOffset.top = r.top,
				geo.origin.size.width = r.width
		}
642454
function (width, height, canvas) {
            // XXX This should probably be a configurable option
            var match;
            match = this._pxregex.exec(height);
            if (match) {
                this.pixelHeight = match[1];
            } else {
                this.pixelHeight = $(canvas).height();
            }
            match = this._pxregex.exec(width);
            if (match) {
                this.pixelWidth = match[1];
            } else {
                this.pixelWidth = $(canvas).width();
            }
        }
783946
function(options) {
      options = options || { };
      
      this.callSuper('initialize', options);
      
      this.set('width', options.width || 100)
          .set('height', options.height || 100);
    }
763070
def background(im, size, background=None, **kwargs):
    
    if not background:
        # Primary option not given, nothing to do.
        return im
    if not size[0] or not size[1]:
        # One of the dimensions aren't specified, can't do anything.
        return im
    x, y = im.size
    if x >= size[0] and y >= size[1]:
        # The image is already equal to (or larger than) the expected size, so
        # there's nothing to do.
        return im
    im = colorspace(im, replace_alpha=background, **kwargs)
    new_im = Image.new('RGB', size, background)
    if new_im.mode != im.mode:
        new_im = new_im.convert(im.mode)
    offset = (size[0]-x)//2, (size[1]-y)//2
    new_im.paste(im, offset)
    return new_im
765555
function (size, background, foreground, format, text) {
    // Random.image( size, background, foreground, text )
    if (arguments.length === 4) {
      text = format
      format = undefined
    }
    // Random.image( size, background, text )
    if (arguments.length === 3) {
      text = foreground
      foreground = undefined
    }
    // Random.image()
    if (!size) size = this.pick(this._adSize)

    if (background && ~background.indexOf('#')) background = background.slice(1)
    if (foreground && ~foreground.indexOf('#')) foreground = foreground.slice(1)

    // http://dummyimage.com/600x400/cc00cc/470047.png&text=hello
    return 'http://dummyimage.com/' + size +
            (background ? '/' + background : '') +
            (foreground ? '/' + foreground : '') +
            (format ? '.' + format : '') +
            (text ? '&text=' + text : '')
  }
988543
function() {

        // background color
        me.game.world.addChild(new me.ColorLayer("background", "#330000"), 0);

        // static background image
        var background = new me.Sprite(480, 320, {
            image: game.texture,
            region : "backdrop.png"
        });
        me.game.world.addChild(background, 1);

        // character animation
        var animationSheet = game.texture.createAnimationFromName([
            "slice04_04.png", "slice05_05.png", "slice12_12.png", "slice13_13.png"
        ]);
        animationSheet.pos.set(200, 200, 2);
        me.game.world.addChild(animationSheet, 2);
    }
691118
function SetMargins() {
    /////////////////////////////////////////////////////////////////
    // When the image is first created - set the margins
    // to be the standard viewport.
    // The standard viewport is the full area of the view surface (or panel),
    // less a margin of 4 character heights all round for labelling.
    // It thus depends on the current character size, set by SetCharacterHeight().
    /////////////////////////////////////////////////////////////////

    $str = preg_split("/\n/",$this->title_txt);
    $nbLines = count($str);

    if ($this->use_ttf == 1) {
      $title_size = $this->TTFBBoxSize($this->title_ttffont_size, $this->title_angle, $this->title_ttffont, 'X'); //An array
      if ($nbLines == 1) {
        $this->y_top_margin = $title_size[1] * 4;
      } else {
        $this->y_top_margin = $title_size[1] * ($nbLines+3);
      }

      //ajo working here
      //$x_label_size = $this->TTFBBoxSize($this->x_label_ttffont_size, 0, $this->axis_ttffont, $this->x_label_txt);

      $this->y_bot_margin = $this->x_label_height ;
      $this->x_left_margin = $this->y_label_width * 2 + $this->tick_length;
      $this->x_right_margin = 33.0; // distance between right and end of x axis in pixels
    } else {
      $title_size = array(ImageFontWidth($this->title_font) * strlen($this->title_txt),ImageFontHeight($this->title_font));
      //$this->y_top_margin = ($title_size[1] * 4);
      if ($nbLines == 1) {
        $this->y_top_margin = $title_size[1] * 4;
      } else {
        $this->y_top_margin = $title_size[1] * ($nbLines+3);
      }
      if ($this->x_datalabel_angle == 90) {
        $this->y_bot_margin = 76.0; // Must be integer
      } else {
        $this->y_bot_margin = 66.0; // Must be integer
      }
      $this->x_left_margin = 77.0; // distance between left and start of x axis in pixels
      $this->x_right_margin = 33.0; // distance between right and end of x axis in pixels
    }

//exit;
    $this->x_tot_margin = $this->x_left_margin + $this->x_right_margin;
    $this->y_tot_margin = $this->y_top_margin + $this->y_bot_margin;

    if ($this->plot_max_x && $this->plot_max_y && $this->plot_area_width ) { //If data has already been analysed then set translation
      $this->SetTranslation();
    }
  }
1184887
function() {
        var dimensionModel = this.dimensionModel;
        var headerHeight = dimensionModel.get('headerHeight');
        var frozenBorderWidth = dimensionModel.get('frozenBorderWidth');
        var resizeHandleView = this.viewFactory.createHeaderResizeHandle(frameConst.L, [headerHeight], true);
        var $resizeHanlder = resizeHandleView.render().$el;
        var $frozenBorder = createDiv(classNameConst.FROZEN_BORDER, {
            marginLeft: -frozenBorderWidth,
            width: frozenBorderWidth
        });

        this.$el.append($resizeHanlder, $frozenBorder)
            .find('.' + classNameConst.SCROLLBAR_FROZEN_BORDER)
            .css({
                marginLeft: -(frozenBorderWidth + CELL_BORDER_WIDTH),
                width: frozenBorderWidth
            });
    }