mirror of
https://github.com/beestat/app.git
synced 2025-07-09 03:04:07 -04:00
Fixed zoom bugs
This commit is contained in:
parent
deb58c79ff
commit
cc19594bf5
@ -98,7 +98,9 @@ beestat.component.card.floor_plan_editor.prototype.decorate_drawing_pane_ = func
|
|||||||
this.floor_plan_.render(parent);
|
this.floor_plan_.render(parent);
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
if (parent.getBoundingClientRect().width > 0) {
|
||||||
self.floor_plan_.set_width(parent.getBoundingClientRect().width);
|
self.floor_plan_.set_width(parent.getBoundingClientRect().width);
|
||||||
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
beestat.dispatcher.removeEventListener('resize.floor_plan_editor');
|
beestat.dispatcher.removeEventListener('resize.floor_plan_editor');
|
||||||
@ -122,7 +124,6 @@ beestat.component.card.floor_plan_editor.prototype.decorate_drawing_pane_ = func
|
|||||||
this.floor_plan_.addEventListener('clear_room', self.rerender.bind(this));
|
this.floor_plan_.addEventListener('clear_room', self.rerender.bind(this));
|
||||||
this.floor_plan_.addEventListener('toggle_snapping', self.rerender.bind(this));
|
this.floor_plan_.addEventListener('toggle_snapping', self.rerender.bind(this));
|
||||||
this.floor_plan_.addEventListener('change_group', self.rerender.bind(this));
|
this.floor_plan_.addEventListener('change_group', self.rerender.bind(this));
|
||||||
this.floor_plan_.addEventListener('zoom', self.rerender.bind(this));
|
|
||||||
|
|
||||||
// Add all of the entities to the SVG.
|
// Add all of the entities to the SVG.
|
||||||
this.entities_ = {
|
this.entities_ = {
|
||||||
|
@ -28,6 +28,8 @@ beestat.extend(beestat.component.floor_plan, beestat.component);
|
|||||||
beestat.component.floor_plan.prototype.render = function(parent) {
|
beestat.component.floor_plan.prototype.render = function(parent) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
|
this.parent_ = parent;
|
||||||
|
|
||||||
this.svg_ = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
this.svg_ = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||||
|
|
||||||
this.defs_ = document.createElementNS('http://www.w3.org/2000/svg', 'defs');
|
this.defs_ = document.createElementNS('http://www.w3.org/2000/svg', 'defs');
|
||||||
@ -211,7 +213,7 @@ beestat.component.floor_plan.prototype.set_zoomable_ = function() {
|
|||||||
this.wheel_handler_ = function(e) {
|
this.wheel_handler_ = function(e) {
|
||||||
if (
|
if (
|
||||||
e.ctrlKey === true &&
|
e.ctrlKey === true &&
|
||||||
e.target.namespaceURI === 'http://www.w3.org/2000/svg'
|
self.parent_[0].contains(e.target)
|
||||||
) {
|
) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
@ -698,6 +700,7 @@ beestat.component.floor_plan.prototype.zoom_ = function(scale_delta, e) {
|
|||||||
this.view_box_.height *= scale_delta;
|
this.view_box_.height *= scale_delta;
|
||||||
|
|
||||||
this.update_view_box_();
|
this.update_view_box_();
|
||||||
|
this.update_toolbar();
|
||||||
|
|
||||||
this.dispatchEvent('zoom');
|
this.dispatchEvent('zoom');
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user