justingardner / mgl

A suite of mex/m files for displaying psychophysics stimuli
http://justingardner.net/mgl
Other
18 stars 22 forks source link

mglLines2 - cannot change size in mgl metal #59

Closed jenhaensel closed 2 years ago

jenhaensel commented 2 years ago

When using the function mglLines2 in mgl metal (running on Big Sur 11.3.1, Matlab vR2021a), the resulting lines remain the same size no matter which value is specified for the 'size' parameter (e.g., 1, 5, and 20 all result in the same size).

benjamin-heasly commented 2 years ago

Hi, thanks, I can see this as well.

My understanding is that line width is not directly supported as a part of the Metal API for line primitives. So in 7b5e4a5fb6ba904c96f50a36ed13c97429b88815 I created a new function, mglMetalLines which draws wide lines as quads. This should allow the width to be in device units as opposed to pixels, and it should allow arbitrary widths. I hope this will be a good way forward!