mirror of
https://github.com/konvajs/konva.git
synced 2026-01-08 18:54:40 +08:00
Fixed container change for a stage. fix #510
This commit is contained in:
@@ -597,8 +597,6 @@ export class SceneContext extends Context {
|
||||
this.setAttr('shadowColor', 'rgba(0,0,0,0)');
|
||||
}
|
||||
|
||||
// TODO - do we need to make like a fill function?
|
||||
|
||||
var hasLinearGradient = shape.getStrokeLinearGradientColorStops();
|
||||
if (hasLinearGradient) {
|
||||
this._strokeLinearGradient(shape);
|
||||
|
||||
14
src/Stage.ts
14
src/Stage.ts
@@ -152,6 +152,10 @@ export class Stage extends Container {
|
||||
}
|
||||
}
|
||||
this._setAttr(CONTAINER, container);
|
||||
if (this.content) {
|
||||
this.content.parentElement.removeChild(this.content);
|
||||
container.appendChild(this.content);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
shouldDrawHit() {
|
||||
@@ -448,13 +452,11 @@ export class Stage extends Container {
|
||||
// content event
|
||||
this._fire(CONTENT_MOUSEDOWN, { evt: evt });
|
||||
|
||||
// always call preventDefault for desktop events because some browsers
|
||||
// try to drag and drop the canvas element
|
||||
// TODO: if we preventDefault() it will cancel event detection outside of window inside iframe
|
||||
// but we need it for better drag&drop
|
||||
// can we disable native drag&drop somehow differently?
|
||||
// Do not prevent default behavior, because it will prevent listening events outside of window iframe
|
||||
// we used preventDefault for disabling native drag&drop
|
||||
// but userSelect = none style will do the trick
|
||||
// if (evt.cancelable) {
|
||||
// evt.preventDefault();
|
||||
// evt.preventDefault();
|
||||
// }
|
||||
}
|
||||
_mouseup(evt) {
|
||||
|
||||
Reference in New Issue
Block a user