adamwulf / JotUI

OpenGL based drawing view built for and used by Loose Leaf for iPad
http://getlooseleaf.com/opensource/
MIT License
268 stars 28 forks source link

Stroke drawn is different along one axis. #30

Closed khaleel8039 closed 6 years ago

khaleel8039 commented 6 years ago

I have used white rectangular image as texture image but width along one axis is different from other axis. Below is the attached texture image and output image which clearly shows stroke width is different in different directions.

square

image-1

adamwulf commented 6 years ago

It's likely that the JotView is being resized after its created, causing its backing to be stretched in the vertical direction.

Are you creating the JotView in a xib, or in code? If in a xib, then it's likely getting the xib's initial size, but then being stretched with constraints/etc to a different size. Instead, create the view in code and wire it up that way so its size never changes after being initialized.

khaleel8039 commented 6 years ago

I have now initialised and added jot view in thru code but the result is still the same. I have attached a video link for your reference. As you can see in video I have a texture image of circle but when we draw it appears to be ellipse(compressing circle in width).

https://www.mediafire.com/file/dub51lw9zx6fa5k/screen-recording.mov

adamwulf commented 6 years ago

Try using JotSharedBrushTexture instead of JotHighlighterBrushTexture when you initialize your texture

khaleel8039 commented 6 years ago

I have tried but app is crashing if I return JotSharedBrushTexture texture instance from datasource method. Could you please provide me a sample with custom brush stroke which will provide same stroke in any directions.

screen shot 2018-04-11 at 1 01 35 pm

screen shot 2018-04-11 at 1 01 16 pm

adamwulf commented 6 years ago

I just pushed up a commit to master that changes the Marker in the jotuiexample project to be a square

khaleel8039 commented 6 years ago

Its working now thanks Adam you saved my life.