|
|
@@ -931,18 +931,10 @@ class SymjaConsole {
|
|
|
const ch = h || panel.clientHeight || window.innerHeight;
|
|
|
c.width = cw * dpr;
|
|
|
c.height = ch * dpr;
|
|
|
- // CSS 精确填充
|
|
|
- Object.assign(c.style, {
|
|
|
- width: cw + 'px',
|
|
|
- height: ch + 'px',
|
|
|
- maxWidth: '100%',
|
|
|
- maxHeight: '100%',
|
|
|
- objectFit: 'contain',
|
|
|
- position: 'absolute',
|
|
|
- left: '50%',
|
|
|
- top: '50%',
|
|
|
- transform: 'translate(-50%, -50%)'
|
|
|
- });
|
|
|
+ c.style.width = cw + 'px';
|
|
|
+ c.style.height = ch + 'px';
|
|
|
+ c.style.maxWidth = '100%';
|
|
|
+ c.style.maxHeight = '100%';
|
|
|
this._canvas = c;
|
|
|
this._ctx = c.getContext('2d');
|
|
|
this._ctx.scale(dpr, dpr);
|