angular-canvas-painter icon indicating copy to clipboard operation
angular-canvas-painter copied to clipboard

The script does not work with OnsenUI

Open KVinS opened this issue 9 years ago • 7 comments

Hi. I'm just starting to deal with Angular. I want to add to your painter in my application. In a separate file, I have everything works as it should. If I try to add it in my application, canvas is not created. The code is not working. I'll be glad if you look. www.zip

KVinS avatar Dec 20 '15 19:12 KVinS

Hey, you are not loading the canvas painter module pw.canvas-painter in your angular application.

var app = angular.module('app', ['onsen', 'pascalprecht.translate', 'web.colorpicker']);

should be

var app = angular.module('app', ['onsen', 'pascalprecht.translate', 'web.colorpicker', 'pw.canvas-painter']);

pwambach avatar Dec 21 '15 09:12 pwambach

Thank you!

KVinS avatar Dec 21 '15 09:12 KVinS

It works, but only on the smartphone. Moreover, there is error in Y. Wrong working to determine the coordinates and offsets similar.

KVinS avatar Dec 21 '15 10:12 KVinS

I did this on jQuerry: http://draw.kvins.ru/lesson.php?l=en&c=adventure_time&i=16#content You leave out the scrolling or something.

KVinS avatar Dec 21 '15 10:12 KVinS

And I can not figure out how to make a dynamic change of the size of the canvas. For example, 100% of the width.

KVinS avatar Dec 21 '15 10:12 KVinS

Dynamic resizing is not possible with the directive. You have to know the size the canvas should have.

pwambach avatar Jan 26 '16 18:01 pwambach

I wrote incorrectly. Determining space available first and then creating the canvas.

KVinS avatar Jan 26 '16 23:01 KVinS