fis-spriter-csssprites
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -38,2 +38,8 @@ /** | ||
module.exports.defaultOptions = { | ||
//最优排列(装箱),混合排序 | ||
'optimalPacking': false | ||
}; | ||
function _process(file, ret, settings, opt) { | ||
@@ -54,2 +60,1 @@ var images = {}; | ||
} | ||
@@ -34,2 +34,4 @@ /* | ||
//获取spriter的配置 | ||
self._settings = fis.config.get('settings.spriter.csssprites'); | ||
/** | ||
@@ -46,3 +48,4 @@ * get position | ||
if (['left', 'right'].indexOf(res[1]) != -1) { | ||
self._type = res[1]; | ||
//left 和 right 都靠右排,so 类型都为`left` | ||
self._type = 'left'; | ||
self._position[0] = (res[1] == 'left') ? 0 : res[1]; | ||
@@ -128,5 +131,8 @@ } else { | ||
getType: function() { | ||
//return this._type; | ||
//测试 | ||
return 'left'; | ||
if (this._settings && this._settings['optimalPacking']) { | ||
//如果使用混排 | ||
return this._type; | ||
} else { | ||
return 'left'; | ||
} | ||
}, | ||
@@ -133,0 +139,0 @@ getDirect: function() { |
@@ -247,3 +247,2 @@ /* | ||
height = height - this.settings.margin; | ||
//@TODO zero为混排,混排暂时不启动,都使用竖排,需要再做实验调整 | ||
//left, zero | ||
@@ -250,0 +249,0 @@ //zero | left |
{ | ||
"name": "fis-spriter-csssprites", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "基于fis的csssprite,支持repeat-x,repeat-x,background-position", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -170,2 +170,2 @@ ##fis-spriter-csssprites | ||
###其他 | ||
[实现原理](https://github.com/fis-dev/fis-spriter-csssprites/wiki/CssSprites%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86) | ||
[实现原理](https://github.com/xiangshouding/fis-spriter-csssprites/wiki/CssSprites%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86) |
25789
588