mirror of
https://github.com/viliusle/miniPaint.git
synced 2026-02-06 13:36:45 +00:00
center canvas if it is much smaller than screen.
This commit is contained in:
parent
6057c8a437
commit
2019fca31d
@ -531,6 +531,9 @@ body .sp-preview{
|
||||
-ms-grid-column: 2;
|
||||
grid-area: main;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.canvas_wrapper{
|
||||
position:relative;
|
||||
|
||||
@ -165,10 +165,9 @@ class Base_gui_class {
|
||||
window.addEventListener('resize', function (event) {
|
||||
//resize
|
||||
_this.prepare_canvas();
|
||||
_this.check_canvas_offset();
|
||||
config.need_render = true;
|
||||
}, false);
|
||||
_this.check_canvas_offset();
|
||||
this.check_canvas_offset();
|
||||
}
|
||||
|
||||
check_canvas_offset() {
|
||||
@ -206,6 +205,8 @@ class Base_gui_class {
|
||||
//change wrapper dimensions
|
||||
document.getElementById('canvas_wrapper').style.width = w + 'px';
|
||||
document.getElementById('canvas_wrapper').style.height = h + 'px';
|
||||
|
||||
this.check_canvas_offset();
|
||||
}
|
||||
|
||||
load_saved_changes() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user