chech fiddle http://jsfiddle.net/hxjZa/2/. 나는 캔버스 요소의 획과 strokewidth를 설정하는 코드를 작성했다. 그들은 잘 작동하지만, 요소의 크기를 조절하기 위해 포인터를 움직일 때 스트로크 폭 값을 설정 한 후에 응답하지 않고 automaicaly가 작게 변경됩니다. 드래그하여 크기를 변경하려고해도 응답이 좋지 않습니다.캔버스 요소 크기 조정 요소가 잘 응답하지 않습니다.
JQuery와 ::
$('#glow_colour').spectrum({
color : "#f00",
change : function(color) {
console.log(' color change' + color.toHexString());
var temp=color.toHexString();
var obj = canvas.getActiveObject();
if (!obj)
return;
obj.set({ stroke: temp });
obj.set({strokeWidth:strokewidth});
canvas.renderAll();
}
});
$("#txt_g_strength").change(function()
{
console.log('strength called');
//alert("stength called");
var obj = canvas.getActiveObject();
var strokewidth=$(this).val();
if (!obj)
return;
obj.set({ strokeWidth: strokewidth});
canvas.renderAll();
});
상기 선 색상 및 폭을 설정하기위한 코드이다.
당신은 당신의 질문은 당신이 무엇을 요구 지워 만들 수를 업데이트 할 수 있습니까? 객체를 선택하면 스트로크 너비를 "10"으로 설정 한 다음 객체를 클릭하고 드래그하여 잘 작동합니다. –
@ Mike'Pomax'Kamerman은 0.5로 설정하려고합니까? – anam
@ Mike'Pomax'Kamermans 및 값을 5로 설정하더라도? u 크기를 조정하려면 요소를 드래그 – anam