mirror of
https://shylinux.com/x/volcanos
synced 2025-04-26 01:04:06 +08:00
opt some
This commit is contained in:
parent
f3dd6ad821
commit
cbf2f78673
@ -174,10 +174,12 @@ Volcanos(chat.ONFIGURE, {help: "图形绘制",
|
|||||||
},
|
},
|
||||||
rect: { // <rect height="30" width="30" ry="10" rx="10" x="60" y="10"/>
|
rect: { // <rect height="30" width="30" ry="10" rx="10" x="60" y="10"/>
|
||||||
data: {points: 2, ry: 4, rx: 4, size: {}, copy: [html.HEIGHT, html.WIDTH, svg.RY, svg.RX]},
|
data: {points: 2, ry: 4, rx: 4, size: {}, copy: [html.HEIGHT, html.WIDTH, svg.RY, svg.RX]},
|
||||||
draw: function(event, can, point) { if (point.length < 2) { return }
|
draw: function(event, can, point, style) { if (point.length < 2) { return }
|
||||||
var p0 = point[0], p1 = point[1]
|
var p0 = point[0], p1 = point[1]; style = style||{}
|
||||||
return {
|
return {
|
||||||
height: Math.abs(p0.y-p1.y), width: Math.abs(p0.x-p1.x), ry: this.data.ry, rx: this.data.rx,
|
height: Math.abs(p0.y-p1.y), width: Math.abs(p0.x-p1.x),
|
||||||
|
ry: style.ry == undefined? this.data.ry: style.ry,
|
||||||
|
rx: style.rx == undefined? this.data.rx: style.rx,
|
||||||
x: p0.x > p1.x? p1.x: p0.x, y: p0.y > p1.y? p1.y: p0.y,
|
x: p0.x > p1.x? p1.x: p0.x, y: p0.y > p1.y? p1.y: p0.y,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -206,7 +208,7 @@ Volcanos(chat.ONFIGURE, {help: "图形绘制",
|
|||||||
this._temp && can.page.Remove(can, this._temp) && delete(this._temp)
|
this._temp && can.page.Remove(can, this._temp) && delete(this._temp)
|
||||||
this._temp = can.onfigure._push(can, svg.G, {}, can.group||can.svg)
|
this._temp = can.onfigure._push(can, svg.G, {}, can.group||can.svg)
|
||||||
|
|
||||||
var rect = can.onfigure._push(can, svg.RECT, can.onfigure.rect.draw(event, can, point), this._temp)
|
var rect = can.onfigure._push(can, svg.RECT, can.onfigure.rect.draw(event, can, point, {}), this._temp)
|
||||||
if (event.type == html.CLICK) {
|
if (event.type == html.CLICK) {
|
||||||
can.onfigure._pid(can, rect), delete(this._temp)
|
can.onfigure._pid(can, rect), delete(this._temp)
|
||||||
}
|
}
|
||||||
@ -300,7 +302,7 @@ Volcanos(chat.ONACTION, {help: "组件菜单", list: [
|
|||||||
var shape = can.Action(svg.SHAPE), figure = can.onfigure[shape]
|
var shape = can.Action(svg.SHAPE), figure = can.onfigure[shape]
|
||||||
figure.grid && figure.grid(event, can, point)
|
figure.grid && figure.grid(event, can, point)
|
||||||
|
|
||||||
var data = figure.draw && figure.draw(event, can, point)
|
var data = figure.draw && figure.draw(event, can, point, {})
|
||||||
var item = data && can.onfigure._push(can, figure.data.name||shape, data, can.group||can.svg)
|
var item = data && can.onfigure._push(can, figure.data.name||shape, data, can.group||can.svg)
|
||||||
event.type == html.CLICK && point.length === figure.data.points && (can.point = [])
|
event.type == html.CLICK && point.length === figure.data.points && (can.point = [])
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
|||||||
_layout: function(can) {
|
_layout: function(can) {
|
||||||
var height = can.onexport.height(can)
|
var height = can.onexport.height(can)
|
||||||
var width = parseInt(can.ConfWidth()), space = parseInt(can.Action("space")||"10")
|
var width = parseInt(can.ConfWidth()), space = parseInt(can.Action("space")||"10")
|
||||||
var step = parseInt((width-2*space) / can.list.length)
|
var step = parseFloat((width-2*space) / can.list.length)
|
||||||
|
|
||||||
can.onmotion.clear(can, can._output), can.onimport._show(can, can._msg)
|
can.onmotion.clear(can, can._output), can.onimport._show(can, can._msg)
|
||||||
can.svg.Val(html.HEIGHT, height), can.svg.Val(html.WIDTH, width)
|
can.svg.Val(html.HEIGHT, height), can.svg.Val(html.WIDTH, width)
|
||||||
@ -84,7 +84,7 @@ Volcanos(chat.ONACTION, {help: "组件菜单", list: [
|
|||||||
|
|
||||||
can.onimport.draw({}, can, {shape: svg.RECT, point: [
|
can.onimport.draw({}, can, {shape: svg.RECT, point: [
|
||||||
order(index, args.step/4, line.close), order(index, args.step/4*3, line.begin),
|
order(index, args.step/4, line.close), order(index, args.step/4*3, line.begin),
|
||||||
], _init: function(view) {
|
], style: {rx: 0, ry:0}, _init: function(view) {
|
||||||
can.core.ItemCB(can.ondetail, function(key, cb) { view[key] = function(event) { cb(event, can, line) } })
|
can.core.ItemCB(can.ondetail, function(key, cb) { view[key] = function(event) { cb(event, can, line) } })
|
||||||
}}, line.begin < line.close? white: black)
|
}}, line.begin < line.close? white: black)
|
||||||
|
|
||||||
|
2
proto.js
2
proto.js
@ -314,7 +314,7 @@ var Volcanos = shy("火山架", {iceberg: "/chat/", volcano: "/frame.js", cache:
|
|||||||
for (var i = 0; i < arguments.length; i += 2) {
|
for (var i = 0; i < arguments.length; i += 2) {
|
||||||
if (typeof key == lang.OBJECT) { res = can.core.Value(can._conf, arguments[i]), i--; continue }
|
if (typeof key == lang.OBJECT) { res = can.core.Value(can._conf, arguments[i]), i--; continue }
|
||||||
res = can.core.Value(can._conf, arguments[i], arguments[i+1])
|
res = can.core.Value(can._conf, arguments[i], arguments[i+1])
|
||||||
} return can.base.isUndefined(res) && key.indexOf(ctx.FEATURE+ice.PT) == -1? can.Conf(can.core.Keys(ctx.FEATURE, key)): res
|
} return res == undefined && key.indexOf(ctx.FEATURE+ice.PT) == -1? can.Conf(can.core.Keys(ctx.FEATURE, key)): res
|
||||||
}, _conf: {},
|
}, _conf: {},
|
||||||
}; can = can||{}, kit.proto(can, proto), kit.proto(proto, meta), _can_path = _can_name||_can_path
|
}; can = can||{}, kit.proto(can, proto), kit.proto(proto, meta), _can_path = _can_name||_can_path
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user