リビジョン 9d2f0219 app/webroot/js/pictcode/block_drawer.js
app/webroot/js/pictcode/block_drawer.js | ||
---|---|---|
54 | 54 |
case blockData.VALUETYPE.SCALAR: |
55 | 55 |
if (value.isVariable) { |
56 | 56 |
drawVariable(block, value, blkPosition, blkHeight, canvasContext); |
57 |
}else if(value.isRandom){ |
|
58 |
drawRandom(block, value, blkPosition, blkHeight, canvasContext); |
|
57 | 59 |
}else{ |
58 | 60 |
drawScalar(block, value, blkPosition, blkHeight, canvasContext); |
59 | 61 |
}; |
... | ... | |
89 | 91 |
drawText(text, x, y, size, canvasContext); |
90 | 92 |
} |
91 | 93 |
|
94 |
function drawRandom(block, value, blkPosition, blkHeight, canvasContext){ |
|
95 |
var xMin = (value.valuePosition.x-value.valueSize*0.0)*blkHeight + blkPosition.x; |
|
96 |
var yMin = (value.valuePosition.y+value.valueSize*(-0.2))*blkHeight + blkPosition.y; |
|
97 |
var xMax = (value.valuePosition.x-value.valueSize*0.0)*blkHeight + blkPosition.x; |
|
98 |
var yMax = (value.valuePosition.y+value.valueSize*0.2)*blkHeight + blkPosition.y; |
|
99 |
var textMin = (value.value.min*1).toFixed(1); |
|
100 |
var textMax = (value.value.max*1).toFixed(1); |
|
101 |
var size = value.valueSize * blkHeight*0.45; |
|
102 |
drawText(textMin, xMin, yMin, size, canvasContext); |
|
103 |
drawText(textMax, xMax, yMax, size, canvasContext); |
|
104 |
} |
|
105 |
|
|
92 | 106 |
function drawVector(block, value, blkPosition, blkHeight, canvasContext){ |
93 | 107 |
var iconLeftTop = { |
94 | 108 |
x:(value.iconPosition.x-value.iconSize/2)*blkHeight + blkPosition.x, |
... | ... | |
339 | 353 |
canvasCenter:gbCenterPositionOfCanvas, |
340 | 354 |
startScroll:startScroll, |
341 | 355 |
scrollCanvas:scrollCanvas, |
356 |
drawCircleFilledText:drawCircleFilledText, |
|
342 | 357 |
}; |
343 | 358 |
}); |
他の形式にエクスポート: Unified diff