垂直布局算法，计算图片位置spritepos_left和spritepos_top，大图的宽度高度
@param {object} images 图片对象，记录align, height, width, repeat
@param {object} spriteDef 图片对应的css规则
330943
function Vertical(images, spriteDef, layout){
  this.images = images;
  this.spriteDef = spriteDef;
  this.layout = layout;
  this.width = 0;
  this.height = 0;
  this.labels = {
    //固定定位
    fix: [],
    //占独立一行
    line: [],
    //紧凑拼图
    close: [],
    //放置在最后
    end: []
  };
  this.blocks = [];
  this.init();
}
1285621
function getCss(shapes, options) {
	const spriteRelative = path.relative(options.styleOutput, options.spritePath);
	return new CSS(shapes, {
		nameSpace: options.nameSpace,
		block: options.dirname,
		separator: options.cssSeparator,
		spriteRelative: path.normalize(spriteRelative).replace(/\\/g, '/')
	}).getCss();
}
949946
function(css, imageIndex){
    var urlVal = css.value[imageIndex];
    var image  = this._isSpriteImage(urlVal, imageIndex, css);
    var images = this.images;

    if (image){
      image = path.relative('./', image);
      image = image.replace(/\\+/g, '/');
      images[css.id] = image;
    }
  }
655350
function (px) {
        if ((px != null) && (this.div != null)) {
            this.div.style.left = px.x + "px";
            this.div.style.top = px.y + "px";
        }
    }
271244
function drawBubblesDataset(animationDecimal, data, config, ctx, statData, vars) {
		var t1, t2, t3, complementaryBar, otherBarHeight, barHeight, i, j, currentAnimPc, fullHeight, sizeTop, sizeBottom, decal;
		var maxBubbleRadius, markerShape, markerStrokeStyle, markerRadius, centerX, centerY, paddingTextX, paddingTextY, dispString, xRadius, yRadius;
		var newRadius, newX, newY;
		var correctedAnimationDecimal;
		for (i = 0; i < data.datasets.length; i++) {
			if (statData[i][0].tpchart != "Bubble") continue;
			for (j = 0; j < data.datasets[i].data.length; j++) {
				correctedAnimationDecimal = correctAnimation(animationDecimal, data, config, i, j, statData, "BUBBLE");
				if (setOptionValue(true, true, 1, "DISPLAYDATA", ctx, data, statData, data.datasets[i].displayData, config.displayData, "displayData", i, j, {
						nullvalue: null
					}) == false) continue;
				if (setOptionValue(true, true, 1, "DISPLAYDATA", ctx, data, statData, data.displayData, config.displayData, "displayData", j, -1, {
						nullvalue: null
					}) == false) continue;
				ctx.save();
				if (!(typeof(data.datasets[i].data[j]) == 'undefined')) {
					currentAnimPc = correctedAnimationDecimal.yAxis;
					ctx.beginPath();
					ctx.fillStyle = setOptionValue(true, true, 1, "MARKERFILLCOLOR", ctx, data, statData, data.datasets[i].pointColor, config.defaultStrokeColor, "pointColor", i, j, {
						nullvalue: true
					});
					ctx.strokeStyle = setOptionValue(true, true, 1, "MARKERSTROKESTYLE", ctx, data, statData, data.datasets[i].pointStrokeColor, config.defaultStrokeColor, "pointStrokeColor", i, j, {
						nullvalue: true
					});
					ctx.lineWidth = setOptionValue(true, true, ctx.chartLineScale, "MARKERLINEWIDTH", ctx, data, statData, data.datasets[i].pointDotStrokeWidth, config.pointDotStrokeWidth, "pointDotStrokeWidth", i, j, {
						nullvalue: true
					});
					markerShape = setOptionValue(true, true, 1, "MARKERSHAPE", ctx, data, statData, data.datasets[i].markerShape, config.markerShape, "markerShape", i, j, {
						nullvalue: true
					});
					markerStrokeStyle = setOptionValue(true, true, 1, "MARKERSTROKESTYLE", ctx, data, statData, data.datasets[i].pointDotStrokeStyle, config.pointDotStrokeStyle, "pointDotStrokeStyle", i, j, {
						nullvalue: true
					});
					maxBubbleRadius = config.bubbleMaxRadius * Math.min(statData[i][j].availableHeight, statData[i][j].availableWidth);
					markerRadius = setOptionValue(true, true, ctx.chartSpaceScale, "MARKERRADIUS", ctx, data, statData, data.datasets[i].pointDotRadius, config.pointDotRadius, "pointDotRadius", i, j, {
						nullvalue: true
					});
					markerRadius = currentAnimPc * maxBubbleRadius * (1 * markerRadius - statData[0][0].bubbleMinVal) / (statData[0][0].bubbleMaxVal - statData[0][0].bubbleMinVal);
					markerRadius = setOptionValue(true, true, 1, "MARKERRADIUS", ctx, data, statData, markerRadius, markerRadius, "pointDotRadius", i, j, {
						nullvalue: true
					});
					centerY = statData[i][j].xAxisPosY - statData[i][j].availableHeight / 2;
					centerX = statData[i][j].yAxisPosX + statData[i][j].availableWidth / 2;
					drawMarker(ctx, centerX + currentAnimPc * (statData[i][j].xPos - centerX), centerY + currentAnimPc * (statData[i][j].yAxisPos - centerY - statData[i][j].yPosOffset), markerShape, markerRadius, markerStrokeStyle);
				}
				ctx.restore();
			}
		}
		if (currentAnimPc >= config.animationStopValue) {
			for (i = 0; i < data.datasets.length; i++) {
				for (j = 0; j < data.datasets[i].data.length; j++) {
					if (setOptionValue(true, true, 1, "DISPLAYDATA", ctx, data, statData, data.datasets[i].displayData, config.displayData, "displayData", i, j, {
							nullvalue: null
						}) == false) continue;
					if (setOptionValue(true, true, 1, "DISPLAYDATA", ctx, data, statData, data.displayData, config.displayData, "displayData", j, -1, {
							nullvalue: null
						}) == false) continue;
					if (typeof(data.datasets[i].data[j]) == 'undefined') continue;
					if (statData[i][0].tpchart != "Bubble") continue;
					maxBubbleRadius = config.bubbleMaxRadius * Math.min(statData[i][j].availableHeight, statData[i][j].availableWidth);
					markerRadius = setOptionValue(true, true, ctx.chartSpaceScale, "MARKERRADIUS", ctx, data, statData, data.datasets[i].pointDotRadius, config.pointDotRadius, "pointDotRadius", i, j, {
						nullvalue: true
					});
					markerRadius = currentAnimPc * maxBubbleRadius * (1 * markerRadius - statData[0][0].bubbleMinVal) / (statData[0][0].bubbleMaxVal - statData[0][0].bubbleMinVal);
					statData[i][j].markerRadius = markerRadius;
					if (!(data.datasets[i].mouseDetection == false)) jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", i, j, statData, setOptionValue(true, true, 1, "ANNOTATEDISPLAY", ctx, data, statData, data.datasets[i].annotateDisplay, config.annotateDisplay, "annotateDisplay", i, j, {
						nullValue: true
					})];
					if (setOptionValue(true, true, 1, "INGRAPHDATASHOW", ctx, data, statData, data.datasets[i].inGraphDataShow, config.inGraphDataShow, "inGraphDataShow", i, j, {
							nullValue: true
						})) {
						ctx.save();
						ctx.textAlign = setOptionValue(true, true, 1, "INGRAPHDATAALIGN", ctx, data, statData, undefined, config.inGraphDataAlign, "inGraphDataAlign", i, j, {
							nullValue: true
						});
						ctx.textBaseline = setOptionValue(true, true, 1, "INGRAPHDATAVALIGN", ctx, data, statData, undefined, config.inGraphDataVAlign, "inGraphDataVAlign", i, j, {
							nullValue: true
						});
						ctx.font = setOptionValue(true, true, 1, "INGRAPHDATAFONTSTYLE", ctx, data, statData, undefined, config.inGraphDataFontStyle, "inGraphDataFontStyle", i, j, {
							nullValue: true
						}) + ' ' + setOptionValue(true, true, ctx.chartTextScale, "INGRAPHDATAFONTSIZE", ctx, data, statData, undefined, config.inGraphDataFontSize, "inGraphDataFontSize", i, j, {
							nullValue: true
						}) + 'px ' + setOptionValue(true, true, 1, "INGRAPHDATAFONTFAMILY", ctx, data, statData, undefined, config.inGraphDataFontFamily, "inGraphDataFontFamily", i, j, {
							nullValue: true
						});
						ctx.fillStyle = setOptionValue(true, true, 1, "INGRAPHDATAFONTCOLOR", ctx, data, statData, undefined, config.inGraphDataFontColor, "inGraphDataFontColor", i, j, {
							nullValue: true
						});
						paddingTextX = setOptionValue(true, true, ctx.chartSpaceScale, "INGRAPHDATAPADDINGX", ctx, data, statData, undefined, config.inGraphDataPaddingX, "inGraphDataPaddingX", i, j, {
							nullValue: true
						});
						paddingTextY = setOptionValue(true, true, ctx.chartSpaceScale, "INGRAPHDATAPADDINGY", ctx, data, statData, undefined, config.inGraphDataPaddingY, "inGraphDataPaddingY", i, j, {
							nullValue: true
						});
						dispString = tmplbis(setOptionValue(true, true, 1, "INGRAPHDATATMPL", ctx, data, statData, undefined, config.inGraphDataTmpl, "inGraphDataTmpl", i, j, {
							nullValue: true
						}), statData[i][j], config);
						if (paddingTextY == 0) {
							newY = 0;
							if (paddingTextX == 0) newX = 0;
							else {
								newX = markerRadius;
								if (paddingTextX < 0) newX = -newX;
							}
							newY = 0;
						} else {
							newRadius = markerRadius + Math.sqrt(paddingTextX * paddingTextX + paddingTextY * paddingTextY);
							newY = Math.sqrt(newRadius * newRadius / (Math.pow(paddingTextX / paddingTextY, 2) + 1));
							if (paddingTextY < 0) newY = -newY;
							newX = newY * paddingTextX / paddingTextY;
						}
						ctx.translate(statData[i][j].xPos + newX, statData[i][j].yAxisPos - currentAnimPc * statData[i][j].yPosOffset - newY);
						var rotateVal = setOptionValue(true, true, 1, "INGRAPHDATAROTATE", ctx, data, statData, undefined, config.inGraphDataRotate, "inGraphDataRotate", i, j, {
							nullValue: true
						}) * (Math.PI / 180);
						ctx.rotate(rotateVal);
						setTextBordersAndBackground(ctx, dispString, setOptionValue(true, true, ctx.chartTextScale, "INGRAPHDATAFONTSIZE", ctx, data, statData, undefined, config.inGraphDataFontSize, "inGraphDataFontSize", i, j, {
							nullValue: true
						}), 0, 0, setOptionValue(true, true, 1, "INGRAPHDATABORDERS", ctx, data, statData, undefined, config.inGraphDataBorders, "inGraphDataBorders", i, j, {
							nullValue: true
						}), setOptionValue(true, true, 1, "INGRAPHDATABORDERSSELECTION", ctx, data, statData, undefined, config.inGraphDataBordersSelection, "inGraphDataBordersSelection", i, j, {
							nullValue: true
						}), setOptionValue(true, true, 1, "INGRAPHDATABORDERSCOLOR", ctx, data, statData, undefined, config.inGraphDataBordersColor, "inGraphDataBordersColor", i, j, {
							nullValue: true
						}), setOptionValue(true, true, ctx.chartLineScale, "INGRAPHDATABORDERSWIDTH", ctx, data, statData, undefined, config.inGraphDataBordersWidth, "inGraphDataBordersWidth", i, j, {
							nullValue: true
						}), setOptionValue(true, true, ctx.chartSpaceScale, "INGRAPHDATABORDERSXSPACE", ctx, data, statData, undefined, config.inGraphDataBordersXSpace, "inGraphDataBordersXSpace", i, j, {
							nullValue: true
						}), setOptionValue(true, true, ctx.chartSpaceScale, "INGRAPHDATABORDERSYSPACE", ctx, data, statData, undefined, config.inGraphDataBordersYSpace, "inGraphDataBordersYSpace", i, j, {
							nullValue: true
						}), setOptionValue(true, true, 1, "INGRAPHDATABORDERSSTYLE", ctx, data, statData, undefined, config.inGraphDataBordersStyle, "inGraphDataBordersStyle", i, j, {
							nullValue: true
						}), setOptionValue(true, true, 1, "INGRAPHDATABACKGROUNDCOLOR", ctx, data, statData, undefined, config.inGraphDataBackgroundColor, "inGraphDataBackgroundColor", i, j, {
							nullValue: true
						}), "INGRAPHDATA", config.inGraphDataBordersRadius);
						ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, setOptionValue(true, true, ctx.chartTextScale, "INGRAPHDATAFONTSIZE", ctx, data, statData, undefined, config.inGraphDataFontSize, "inGraphDataFontSize", i, j, {
							nullValue: true
						}), true, config.detectMouseOnText, ctx, "INGRAPHDATA_TEXTMOUSE", rotateVal, statData[i][j].xPos + paddingTextX, statData[i][j].yAxisPos - currentAnimPc.mainVal * statData[i][j].yPosOffset - paddingTextY, i, j);
						ctx.restore();
					}
				}
			}
		}
		if (animationDecimal.animationGlobal >= 1 && typeof drawMath == "function") {
			drawMath(ctx, config, data, msr, {
				xAxisPosY: xAxisPosY,
				yAxisPosX: yAxisPosX,
				valueHop: valueHop,
				scaleHop: scaleHop,
				zeroY: zeroY,
				calculatedScale: calculatedScale,
				calculateOffset: calculateOffset,
				additionalSpaceBetweenBars: additionalSpaceBetweenBars,
				barWidth: barWidth
			});
		}
	}
649554
function mapSpritesProperties(images, options, sprites) {
	return new Promise(function (resolve) {
		sprites = _.map(sprites, function (sprite) {
			return _.map(sprite.coordinates, function (coordinates, imagePath) {
				return _.merge(_.find(images, {path: imagePath}), {
					coordinates: coordinates,
					spritePath: sprite.path,
					properties: sprite.properties
				});
			});
		});
		resolve([images, options, sprites]);
	});
}
867957
def sprite_position(map, sprite, offset_x=None, offset_y=None):
    
    map = map.render()
    sprite_maps = _get_cache('sprite_maps')
    sprite_map = sprite_maps.get(map)
    sprite_name = String.unquoted(sprite).value
    sprite = sprite_map and sprite_map.get(sprite_name)
    if not sprite_map:
        log.error("No sprite map found: %s", map, extra={'stack': True})
    elif not sprite:
        log.error("No sprite found: %s in %s", sprite_name, sprite_map['*n*'], extra={'stack': True})
    if sprite:
        x = None
        if offset_x is not None and not isinstance(offset_x, Number):
            x = offset_x
        if not x or x.value not in ('left', 'right', 'center'):
            if x:
                offset_x = None
            x = Number(offset_x or 0, 'px')
            if not x.value or (x.value <= -1 or x.value >= 1) and not x.is_simple_unit('%'):
                x -= Number(sprite[2], 'px')
        y = None
        if offset_y is not None and not isinstance(offset_y, Number):
            y = offset_y
        if not y or y.value not in ('top', 'bottom', 'center'):
            if y:
                offset_y = None
            y = Number(offset_y or 0, 'px')
            if not y.value or (y.value <= -1 or y.value >= 1) and not y.is_simple_unit('%'):
                y -= Number(sprite[3], 'px')
        return List([x, y])
    return List([Number(0), Number(0)])
219692
protected void centerSprite ()
    {
        if (_sprite != null) {
            Dimension d = getSize();
            int shei = _sprite.getHeight();
            int x = d.width / 2, y = (d.height + shei) / 2;
            _sprite.setLocation(x, y);
        }
    }
1359972
function () {
        var self = this, style, rect;

        style = self.getEl().style;
        rect = self._layoutRect;

        style.left = rect.x + 'px';
        style.top = rect.y + 'px';
        style.zIndex = 0xFFFF + 0xFFFF;
      }
1059460
function(params){
    var id = this.get('id');
    var basename = this.get('basename');
    var ids = this.get('ids');
    var spriteId = id ? basename + id : basename;
    var imgPath = this.get('imgPath');

    this.sprites[spriteId] = mixin(conf, {});
    this.sprites[spriteId]['images'] = {};
    var config = this.get('config');
    //合并全局配置
    mixin(config['global'], this.sprites[spriteId]);
    if (imgPath) {
      var imgDest = imgPath + '/' + spriteId + '-sprite.png';
      this.sprites[spriteId]['filename'] = imgDest;
      var imgCss = imgDest;
      if (this.get('relative')) {
        imgCss = this.get('relative') + '/' + spriteId + '-sprite.png';
        this.sprites[spriteId]['relative'] = imgCss;
      }

      var output = this.get('output');
      output[imgCss] = path.join(path.dirname(this.get('file')), imgDest);
    }

    var dir = params[PARAMS['direction']];
    if (dir && dir == PARAMS['horizontal']) {
      this.sprites[spriteId]['layout'] = 'horizontal';
    }

    if (config[id]) mixin(config[id], this.sprites[spriteId]);

    ids[id] = spriteId;
    id++;
    this.set('id', id);
    return spriteId;
  }
42096
function (el, spriteWidth, spriteHeight) {
        // TODO, inner text, shadow
        var rect = el.getBoundingRect();

        var scaleX = spriteWidth / rect.width;
        var scaleY = spriteHeight / rect.height;
        el.position = [-rect.x * scaleX, -rect.y * scaleY];
        el.scale = [scaleX, scaleY];
        el.update();
    }
705987
function Sprite(spriteAtlas, frame, name) {
                this._spriteAtlas = spriteAtlas;
                this._frame = frame;
                this._name = name;
            }
1320436
function tileToPixelCoords(x, y, v) {
         var ret = v || new me.Vector2d();
         return ret.set((x - y) * this.hTilewidth + this.originX, (x + y) * this.hTileheight);
       }
38465
function( background, sprites, priorities ) {
		this.bgBuffer.set( background, this.index );
		this.spriteBuffer.set( sprites, this.index );
		this.prioBuffer.set( priorities, this.index );
		this.index += 256;
	}
1259670
function (params) {
        this.$id = 'graphic';
        this.$deps = []; // Position dependency added later if relative positioning is true.

        params = _.extend({
            alpha: 1,
            anchor: {
                x: 0.5,
                y: 0.5
            },
            relative: true,
            scale: {
                x: 1,
                y: 1
            },
            tint: 0xffffff,
            translate: {
                x: 0,
                y: 0
            },
            visible: true,
            z: 0
        }, params);

        if (params.relative) {
            this.$deps.push('position');
        }

        this.alpha = params.alpha;
        this.anchor = params.anchor;
        this.relative = params.relative;
        this.scale = params.scale;
        this.tint = params.tint;
        this.translate = params.translate;
        this.visible = params.visible;
        this.z = params.z;

    }
682180
function(parsedAttributes) {
      if (parsedAttributes.left) {
        this.set('left', parsedAttributes.left + this.getWidth() / 2);
      }
      this.set('x', parsedAttributes.left || 0);
      if (parsedAttributes.top) {
        this.set('top', parsedAttributes.top + this.getHeight() / 2);
      }
      this.set('y', parsedAttributes.top || 0);
      return this;
    }
1152541
function (element, parentNode) {
                var ren = this,
                  parentStyle = parentNode.style,
                  imgStyle = element.tagName === 'IMG' && element.style; // #1111

                css(element, {
                    flip: 'x',
                    left: pInt(parentStyle.width) - (imgStyle ? pInt(imgStyle.top) : 1),
                    top: pInt(parentStyle.height) - (imgStyle ? pInt(imgStyle.left) : 1),
                    rotation: -90
                });

                // Recursively invert child elements, needed for nested composite shapes like box plots and error bars. #1680, #1806.
                each(element.childNodes, function (child) {
                    ren.invertChild(child, element);
                });
            }