Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mizrael committed Sep 24, 2024
1 parent 64d3e12 commit cc168e1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions samples/Blazorex.Samples.SimpleCanvas/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,19 @@
}

private void Render()
{
_context.ClearRect(0, 0, _width, _height);

{
_context.ClearRect(0, 0, _width, _height);

// fills the background with a dark blue color
_context.FillStyle = "rgb(0, 0, 100)";
_context.FillRect(0, 0, _width, _height);

// draws a yellow border around the sprite
_context.StrokeStyle = "rgb(255, 255,0)";
_context.LineWidth = 3;
_context.StrokeRect(_x, _y, _spriteWidth, _spriteHeight);

// draws the sprite
_context.DrawImage(_spritesheet, _x, _y, _spriteWidth, _spriteHeight);
}
}

0 comments on commit cc168e1

Please sign in to comment.