Hi <@U016EM8L91B> this might be wishful thinking b...
# magic
e
Hi @Tim Edwards this might be wishful thinking because I understand that you are extremely busy, but - after using magic on a daily basis for 6 months now - I am wondering if it would be at all possible to change the Zoom feature to make it similar to Xschem, where the mouse roller zooms in/out using the crosshairs of the mouse as the point of interest? I absolutely love Magic - apart from the Zoom. In my ignorance this sounds like a simple fix, but I am sure its much more complicated than it seems! 😂
r
Customizable element colors too! Light gray background with light colors is hard on the eyes
t
Fixing the zoom function is actually pretty easy because it's a macro. I have a meeting right now, but I'll give you an answer afterwards. @Ryan Wans: Sorry, not a macro and very difficult to do (a lot of coding work---the color scheme is pretty deeply built into the source code). Honestly, I like the light gray background because I find it much easier on my eyes than a black background. Not sure why other people don't agree.
e
That would be amazing. I can't tell you the amount of times I've switched from Xschem to Magic and instinctively tried used the mouse roller with no avail! I agree about the grey background - John uses magic -d CAIRO or magic -d OGL (which offers another colour scheme and might be worth a try, @Ryan Wans) but I prefer the original colours of Magic
The "ctrl + z" feature of jumping to your box is good and worth keeping, its just the general purpose zooming in/out which is often frustrating
h
The mouse roller zooming could be cool, but please keep the keystrokes as well for zooming 🙂 PS I also find magic pretty effective for layout. The best feature ever is the net tracing :-)
@Ellen Wood Defining your own keystrokes/mouse actions is relatively straightforward. For inspiration, look into $PDKPATH/lib.tech/magic/sky130A-BindKeys I guess you need to redefine this to get your intended behaviour:
Copy code
# control mouse wheel bindings for zoom in/out
macro Control_XK_Pointer_Button4 "zoom 0.70711"
macro Control_XK_Pointer_Button5 "zoom 1.41421"
The missing ingredient is now the TCL magic from @Tim Edwards
t
@Harald Pretl: No, that's pretty much it right there. I did need to shorten it to this to get it to work:
Copy code
macro Button4 "zoom 0.70711"
macro Button5 "zoom 1.41421"
which might just reflect whether or not "Num Lock" is on. Or possibly the XK_Pointer is required when using Control_.
@Harald Pretl, @Ellen Wood: Copy those two macro commands to the file
/usr/local/lib/magic/sys/site.def
and they will be applied every time you start magic (and they will not get overwritten by updates).
e
@Tim Edwards @Harald Pretl thank you so much! I will give that a go 🙂
h
@Tim Edwards That works. I think it would be good to center in addition to where the cursor is, something like @Ellen Wood:
Copy code
macro Button4 "center; zoom 0.70711"
macro Button5 "center; zoom 1.41421"
e
Finally had a chance to test these today! Although its still not quite as sophisticated as the Zoom in Xschem (where you can hover your mouse over a point of interest and use the roller to zoom into that exact spot) its much better than before! Hooray and thank you
@Harald Pretl adding 'center' makes the zoom jump all over the place, I think because it re-centers with each mouse roll 'click' and you can end up way off screen in a few seconds!
h
Yes, exactly. You need to mouse the moise pointer to follow your point of interest when clicking the wheel. A more sophisticated version would be good, maybe I find time to think about it…