Skip to content

Commit

Permalink
size test
Browse files Browse the repository at this point in the history
  • Loading branch information
matrem committed Jan 6, 2024
1 parent 4a4a4d4 commit f9481e0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion canvastransform/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
<link rel="stylesheet" href="../libs/style.css" />
<link rel="stylesheet" href="style.css" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>JS test : canvas transform</title>
</head>

<body>
<div id="draw">
<canvas id="canvas" width="300" height="300">canvas</canvas>
<canvas id="canvas">canvas</canvas>
</div>
</body>

Expand Down
8 changes: 5 additions & 3 deletions canvastransform/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ body {

div#draw {
overflow: hidden;
display: block;
margin: 0;
padding: 0;
border: 0;
background-color: red;
width: 100vw;
height: 100vh;
/*border: solid red 3px;*/
position: relative;
}

canvas#canvas {
display: block;
margin: 0;
padding: 0;
border: 0px;
width: 100%;
height: 100%;
/*border: solid yellow 3px;*/
}
2 changes: 2 additions & 0 deletions libs/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ draw.TransformedDrawing = class extends draw.Drawing {
this.tipCanvas.id = tipId;
let tipW = this.width / 2.0;
let tipH = tipW / 15.0;
this.tipCanvas.margin = 0;
this.tipCanvas.padding = 0;
this.tipCanvas.width = tipW;
this.tipCanvas.height = tipH;
this.tipCanvas.style.position = "relative";
Expand Down

0 comments on commit f9481e0

Please sign in to comment.