Öö Tiib
12/6/2015 4:08:00 PM
On Thursday, 3 December 2015 17:20:32 UTC+2, fir wrote:
> W dniu niedziela, 29 listopada 2015 21:34:11 UTC+1 uzytkownik Julio Di Egidio napisal:
> > On Sunday, November 29, 2015 at 1:28:02 PM UTC, fir wrote:
> > > afail in js/canvas there is no call to fillrect, fillcircle etc method but instead something like
> > >
> > > ctx.beginPath();
> > > ctx.rect(brickX, brickY, brickWidth, brickHeight);
> > > ctx.fillStyle = "#0095DD";
> > > ctx.fill();
> > > ctx.closePath();
> > >
> > > is used... it seems overal a bit weird decision.. dont you think so? (or maybe not?) at least it wonders me a bit, Why is that so - is there some rationale under it?
> >
> > Generally, under HTML5 styles follow the CSS model.
> >
> > Julio
>
> I see i was wrong there is simple firlect in canvas too (i thought its absent and that seemd strange/interesting to me)
Perhaps 'ctx.fill' is meant for filling more complex shape than 'ctx.rect'
(or for filling several shapes at once). If you need to fill just single
rect then 'ctx.fillrect' is indeed more rational to use.