pwambach / angular-canvas-painter

Angular.js directive to paint on a canvas on desktop or touch devices
MIT License
116 stars 35 forks source link

The script does not work with OnsenUI #22

Open KVinS opened 8 years ago

KVinS commented 8 years ago

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

pwambach commented 8 years ago

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']);
KVinS commented 8 years ago

Thank you!

KVinS commented 8 years ago

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

KVinS commented 8 years ago

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 commented 8 years ago

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

pwambach commented 8 years ago

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

KVinS commented 8 years ago

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