Javascript绘制矩形边框

时间:2019-02-15 01:24:38

标签: javascript html p5.js

我正在尝试制作一个在现有矩形边框之上的矩形边框。但是,新的矩形比旧的矩形大。

会发生什么:

image

我正在尝试使蓝色边框覆盖红点。

clearRect不起作用,因为我只是试图覆盖红点,而不是填充零件盒。

var removeLast = function(l) {
    var that = {};

    that.draw = () => {
        rectMode(CENTER);
        strokeWeight(5);

        stroke(0,255,255);
        noFill();
        rect(that.getX(), that.getY(), that.getWidth(), that.getHeight());
        l.draw();
    }
    return that;
}

0 个答案:

没有答案
相关问题