Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resizable rectangle #21

Open
mrklev opened this issue Sep 13, 2018 · 0 comments
Open

resizable rectangle #21

mrklev opened this issue Sep 13, 2018 · 0 comments

Comments

@mrklev
Copy link

mrklev commented Sep 13, 2018

HI,
I need to create a draggable and resizable rectangle. Currently I can drag the rectangle but I can't resize it. How can I do it , which method should I use?

code:
html component:
<ko-stage #stage [config]="configStage">
<ko-layer #layer>
<ko-rect [config]="configRect"#rect >

ts component:
import { Component, ViewChild, OnInit } from '@angular/core';
import { of, Observable } from 'rxjs';
import { KonvaComponent } from 'ng2-konva';

@component({
selector: 'app-camera-img',
templateUrl: './camera-img.component.html',

})
export class CameraImgComponent implements OnInit {
@ViewChild('stage') stage: KonvaComponent;
@ViewChild('layer') layer: KonvaComponent;
@ViewChild('rect') rect: KonvaComponent;

public configStage: Observable = of({
width: 400,
height: 200
});

public configRect: Observable = of({
x: 160,
y: 60,
width: 100,
height: 90,
fill: 'red',
name: 'rect',
stroke: 'black',
draggable: true,
});

constructor(
private apiBackendService: ApiBackendService
) {
}
ngOnInit() {
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant