1

我有这个简单的代码,我想设置图像的最小宽度和最小高度,我设置了最小值。高度和最小。宽度,当涉及到这些限制时,标签可以随意关闭,但是当我点击图像时,标签出现在不同的位置,我无法放大我的照片..

if (width && height) {
    if (MIN_WIDTH < width || MIN_HEIGHT < height) {
        image.setSize(width, height);
    } else {
        group.children[1].hide();
        group.children[2].hide();
        group.children[3].hide();
        group.children[4].hide();
        $(".toSmall").dialog({
            modal: true,
            width: 350,
            height: 180,
            buttons: {
                "OK": function() {
                    $(this).dialog("close");
                    image.setSize(image.width, image.height);
                    console.log(activeAnchor.attrs.draggable = false);
                    activeAnchor.attrs.x *= 2;
                    activeAnchor.attrs.y *= 2;
                    image.off('click');
                    // activeAnchor.setDragOnTop(false);
                    // activeStage.draw();
                }
            }
        });
    }
}
4

1 回答 1

0

我找到了自己的解决方案

if (width && height) {
    if (MIN_WIDTH < width || MIN_HEIGHT < height) {
        image.setSize(width, height);
    } else {
        $(".toSmall").dialog({
            modal: true,
            width: 350,
            height: 180,
            buttons: {
                "OK": function() {
                    activeAnchor.hide();
                    activeAnchor.attrs.y *= 2;
                    image.off('click');
                    $(this).dialog("close");
                    update(activeAnchor);
                    activeStage.draw();
                }
            }
        });
    }
}
于 2013-08-22T15:38:23.867 回答