Knob LAF - Curve line (or maybe use a bit of an arc?)
-
I've been redrawing a slider I made in knobman - the lateral pointer bit is a rectangle, but really it should be a little curved, like an arc, but obviously only a tiny bit of it
Anyone know of a way to do this?
the line of code:
g.fillRect(Rect.translated(Rect.withSizeKeepingCentre(obj.area, 4, 1.4), 0, -16.8));
-
@DanH said in Knob LAF - Curve line (or maybe use a bit of an arc?):
Rect.translated(Rect.withSizeKeepingCentre(obj.area
I don't have an answer, you need @ustk for this. But have you seen the new Rectangle object?
-
-
@DanH Day saved!
HiseSnippet 1215.3ocsV0raabCDlqs2zHg1fFz9.rvmjcTj0JYq3.if3eUqPrcDrRCJPPgAEWJIVwkTfKW6nVjGtdquA8Anu.8TuzCtCWtq1UUJ1sFM5fsl+93mFNbloqRRnQQRExo7alNghb9b2dSE5QGMByDnNGibdj6Y3HMU4YUc3zI3nHZ.xwY0uwnvozZnjO+wKODywBBMWEB8VIiPOkExz4Z6t+qXbdab.8MrvBdu89cHRwQRtLF3ypt0QSvjw3gzywF2VwE8s3nQHmMc8284D71jcZ4S2teqfmEzpOYWRyA3lAOeGbyju1pYylHmGbR.SKU8zXMMB.8PYvzdijWKrGvaYQr9bpQvG0CNYqZzQiX7ftYImHDxYst4opUsopu18LV.al97T1WlXvKOhhIMmUtMJ4WjR0ucJ4TfRqYozic6QTrI5bKF97UoZyYj+bTxZEshx08HoPSE5Zg3wz1JPnCHqFfIzJspWupG7mM1qL3UjjSqQ3TrpBnnbY3lKR6cEV4MVH6efhb4oGz16EdY.RTT326oRBlepTN9.QPaJkmDag.ponCYlps1wBhlIEUVOPgu9BoFql1iyBnp0q5MHy3vpdx9+3Fk+4xkFVKhps0NU.c05OzJ.G.Xa.TvcBmylDQSrhA1XrTtjgwgvEGP.+EnaWrdjghIdMQxL4Bvwa2uTzZ7w8x5mhRzdkJ8BuKfufEC4ySMiK5QLxXAbi4AtkY7cM9gsZTO0CrhbJULTOx3wYvATqams7qWq9d.zk1ZKOt0pb..F03tWElvSgCXXwFVLhfjqkIOs4lYXr8dkr.XBKwClXnMGjAl4dKkEgS3Lcb.0vhbLZTDiAwbtGQdEUAunWDBpHHgBVx7jbH2z769JLOldtTEh4rehFrWISRL6ZqFNH.9eESBEJfBhIzfJyRcaVu1NaT0haUywXRt42k2Qv9IAaH2Syy0a0nVcqxmLuRCzYW+2AvMVBqVrJloogVQeagr40PRcT1O9pypdqMjpOTFKBhp3CToZd0iMz4QVSeut3KjY.mmZpVnj++F34ztwxociYztwsh7GL8GxdEMzbFgSjBPnx5uBJc7WeCyIuPWkBcTRZNUNqigmTbtTSesnRRSixenr2+zzfAK0lgDJImSUK0rYRl51BrhHNrOUU0KoTdliPm64GG39wGGTbBEwlSJ3nTzQvzudBMUdwAFnzDoYzQJq.W0ICNdT5HBaOVDClK7YtIoXTBgSmRue4e62eI565bLViyfAPDNkITnCg4GfywzqfY914QkbOlFMVKmj3a5cGx4g24g9970BX6Osnv0r.MrDfqyuBhinrgizYR4kcP.O3FzedCZNsMRT+Kn+xtFxBSOg41xfXNVO+vbyZNoFfqz4lbZlNJhX5oEWC5+sI7+ao3ic6xzjQKmiqrDNBWceJ3X5dQeg6ICF.c8xI3Zts+9OMKAgtPFalLAibTLnnw873vdvUMgBmtPP4lmTNqXJ9sx0MxlLPOnoahvMvmTi9FYmTi9YFQgXhRdIw9jwr40CSz.bRjrYZIXEYP1a92JIeBgEAujPlGpEBrw8Mvl22.299F3N22.aceC7Y22.28tCzrm9AwZYn8YCBcV2SR5s43bh.CUfIUqn+V5dc8E
-
@ustk bravo! Thanks
However in the snippet I'm getting an error on line 16:
Script Processor1: Line 16, column 27: This expression is not a function!
EDIT - maybe you're using the shiny new rectangle function, will try again with latest HISE.
EDIT EDIT - Nope, still get that error. What is 'Rectangle'?
-
@DanH said in Knob LAF - Curve line (or maybe use a bit of an arc?):
EDIT EDIT - Nope, still get that error. What is 'Rectangle'?
Yes you need the latest HISE with the shiny new feature - develop branch.
-
@d-healey hmmm, thought I just did
-
@ustk this is perfect, thanks so much
-
@DanH said in Knob LAF - Curve line (or maybe use a bit of an arc?):
the lateral pointer bit is a rectangle
For avoidance of doubt, and as @ustk's snippet also says, it isn't a rectangle. It is an arc, which you can think of as a slice of a circle.
-
@Orvillain In my original example it is a rectangle. In @ustk's solution it is an arc.
-
@DanH said in Knob LAF - Curve line (or maybe use a bit of an arc?):
@Orvillain In my original example it is a rectangle. In @ustk's solution it is an arc.
Yes. It never should have been is my point!