Line caps style

Dear Community,

I draw the watch hands by drawing a line (drawLine()). I set the pen width quite significant, and that makes the line's cap visible, and it looks like ∩ (rounded edges), with all the ugliness depending on the angle, and I would like to have it with sharp edges, like П.

As a workaround, I draw a black circle on top with radius same as length of the hand to crop the cap, but I obviously don't like that.

Drawing a polygon is not an option as that would require more compute power.

Any ideas are much appreciated!

  • Instead of drawing a line with a given thickness, you should really consider creating an array of points that describe a rectangle and then rotating and rendering that with the dc.drawPolygon() API like we do in the Analog sample app. If the device has support, you can also enable anti-aliasing.

    Assuming you're still using Eclipse, you should be able to find the sample programs by clicking ConnectIQ > Samples from the menu bar.