mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Center canvas with an extended margin: auto trick. Gets rid of half-pixel positions possible with translate().
This commit is contained in:
@@ -27,21 +27,29 @@ device-screen {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
device-screen .screen-touch {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
device-screen .screen-center {
|
||||
position: absolute;
|
||||
top: -100%;
|
||||
right: -100%;
|
||||
bottom: -100%;
|
||||
left: -100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
device-screen canvas {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
margin: auto;
|
||||
|
||||
pointer-events: none; /* MUST HAVE or touch coordinates will be off */
|
||||
transition: width 100ms linear, -webkit-transform 250ms ease-in-out;
|
||||
-webkit-transform-origin: 50% 50%;
|
||||
transform-origin: 50% 50%;
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: translate(-50%, -50%) rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
device-screen .finger {
|
||||
|
||||
Reference in New Issue
Block a user