Open CoderMaurice opened 5 years ago
Look into how the highlighter pen is currently implemented. setting its color to black and opacity to 1.0 should get you very close. Then edit the rotation to be locked to pi/4 and i think that'll get you 99% of the way there.
Be sure and re-pull master. I just pushed up some fixes to jotuiexample and added that Highlighter class
Thanks for your quick reply
Ah right, for the rotation, you'll need to customize JotView.m. I don't actually expose rotation angle like i remembered.
In JotView.m, line 1502, you'll see:
CGFloat rot = atan2(diff.y, diff.x);
change that to:
CGFloat rot = M_PI_4;
I think that'll do what you want. You can play with different values there to get the effect you want.
For the opacity, you can try darkening the highlighter.png texture so that it's more opaque. The included one is fairly transparent I believe. You can also edit the alpha directly in CurveToPathElement.m
on line 213.
change the following:
CGFloat alpha = _colorComponents[3] / kDivideStepBy;
to
CGFloat alpha = 1.0;
both of those source edits should do what you want. the 2nd source edit will affect all brushes though, so if you want to support more than just your custom brush it might need a bit more surgery to get only that brush darker. I'd try the texture edit first, I think there's a high chance that'll do what you need.
Thank you so much, I will try.
Hi, Thank you very much for this great project,
How to get a pen like this, help~~~