openscopeproject / InteractiveHtmlBom

Interactive HTML BOM generation plugin for KiCad, EasyEDA, Eagle, Fusion360 and Allegro PCB designer
MIT License
3.71k stars 475 forks source link

Zoom ability #22

Closed TechJA closed 6 years ago

TechJA commented 6 years ago

First of all congrats for your excellent work!

Are you thinking of implementing the ability to zoom in/out on the PCB panels? Being limited to screen size is very limiting for those of us with small screens. Adjusting the panel size just isn't enough for larger boards.

qu1ck commented 6 years ago

I will keep this as a wishlist, but I'm not sure how useful it is. The main feature of this plugin is to quickly give an overview of all places on the board where a component is located. From that you can look at the board and either quickly find reference designator on silkscreen since you know where to look at, or compare with relative positions of other pads/silkscreen marks to quickly locate your footprint. If you have board zoomed in and part of it is outside of the view, how would you know where to look?

Screen size is an issue but unless you are trying to do A4 size boards with 0603 components on 1080p monitor, it's not a big issue. In #20 a big board was posted, it can be viewed fine on 15" laptop.

TechJA commented 6 years ago

If you have board zoomed in and part of it is outside of the view, how would you know where to look?

It'll still be a problem on people with even smaller screens (small notebooks or even 2-in-1 computers). My suggestion would be to double-click on the selection list to lock whatever we selected, then, on the board view, we could freely move and scroll to zoom in/out.

hildogjr commented 6 years ago

Nice work with the zoom @qu1ck. Just a comment about user experience, nothing to worry but the scroll is the opposite of the behavior in Pcbnew, is this the default behavior on java script? About your changes in pcbnew.py I am waiting the Nightly release of KiCad, the compilation for Ubuntu is broken since 2 weeks ago (I am in contact with the support). So I will test in that big board and give you some feedback.

qu1ck commented 6 years ago

What do you mean opposite? For me scrolling up zooms in both in pcbnew and in bom. There is no "default" behavior, it's all hand coded.

hildogjr commented 6 years ago

The zoom in / zoom out works in one direction when I roll the scroll button in the mouse in Pcbnew and in the opposite when roll in the iBOM generated HTML. Even is the opposite direction of the default browser zoom (rolling to front, that is the default OS zoom in makes zoom out in your page).

Using: Firefox v61 on Ubuntu. Is not really a bug, but I release that was zooming in when I wanted zoom out, and vice-versa.

But was really a nice job: zoom, pan and fit capability.

qu1ck commented 6 years ago

Yeah, for me both chrome and firefox zoom same way. Can you tell me does it zoom in or out when you scroll up? Does direction change if you use chrome? I suspect it's pcbnew doing something in non-standard way and has reverse direction on linux, not browser.

qu1ck commented 6 years ago

Also do you have "natural scrolling" or something like that enabled in linux? I.e. when you scroll up does the page move up or down?

hildogjr commented 6 years ago

Normal behavior on Linux (Ubuntu), Pcbnew, Firefox and Chromium ("Chrome"); scrolling up (the up part of the wheel in direction to the monitor) the behavior is zoom in / page goes up, same on the three softwares. Firefox and Chrome here have the same behavior. Scrolling down (up part of the wheel to my direction) I have (in the 3 softwares): page goes down / zoom out.

Here, only the iBOM page changes the zoom in / zoom out behavior.

Other interesting debug: this mine is notebook, so I have the the zoom by 2 fingers on the pad (when I am not using external mouse). In Chrome this zoom works in the right direction (zooming in when moving away the finger), in Firefox appear not work but may be because even in the Chrome this kind of iteration was so fast that a little movement did all the zoom in / zoom out.

And yes, I realize that I do have the "Natural scrolling" but affect just the Touchpad zoom (when I uncheck it change the behavior reported above in the Chrome).

TechJA commented 6 years ago

qu1ck, They're right (Firefox on Windows). Scrolling up zooms out, scrolling down zooms in. It should be the other way around.

qu1ck commented 6 years ago

Reopening to investigate further.

qu1ck commented 6 years ago

Yeah I have math totally wrong on zoom calculation. Will fix soon.

hildogjr commented 6 years ago

No problem. Our function is help debugging.

qu1ck commented 6 years ago

I believe this should be fixed now. Please try the latest.

TechJA commented 6 years ago

@qu1ck , it's possible lock the color of the select line when you move the cursor to PCB's panels?

linha_fixa

Could you implement a feature (ex: add a button) to recenter the the pcbs and reset the zoom to full view?

qu1ck commented 6 years ago

Could you implement a feature (ex: add a button) to recenter the the pcbs and reset the zoom to full view?

Right click does that.

it's possible lock the color of the select line when you move the cursor to PCB's panels?

Yes, that's doable.

TechJA commented 6 years ago

Could you implement a feature (ex: add a button) to recenter the the pcbs and reset the zoom to full view?

Right click does that.

confirmed - Thanks!

hildogjr commented 6 years ago

Yes @qu1ck, so much smoothly the zoom now! (both: mouse and touch pad) Now mouse wheel works as the conventional direction of my OS Ubuntu (zoom on Firefox, Chrome, Pcbnew and others software having the same direction). The touch pad is working in both too (before wasn't), but in the opposite direction (in both), the "Natural scrolling touckpad configuration" have no effect on this.

hildogjr commented 6 years ago

I tested on other computer (Linux Firefox also) but with the zoom on the lateral of the trackpad and worked fine (direction and "quantity"). The other computer (first one) use the 2-fingers zoom and the behavior may be related with some really specific hardware-software combination. May be not interesting use so much time in this correction, so.

qu1ck commented 6 years ago

So I tried this on a macbook pro with touchpad. Woah it's smooth! And inverted. But looking at the events browser is firing there is really nothing I can do about it, it looks just like mouse wheel rotated in opposite direction. I suspect 2 fingers zoom on linux would be the same but I can't confirm. Laptops that have separate scrolling area probably work same as actual mouse wheel, that's why it works for you.

I'm going to call this one fixed, if anyone has ideas on how to improve detection of touchpads, feel free to drop a line here or send a pull request.

qu1ck commented 6 years ago

Also found this gem of a bug while googling on 2 finger touchpad zoom. https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7134034/

TLDR is that Edge is the new IE. Microsoft claims that it supports standards and in the same breath says that some standards are less standard than others and introduces alternative API to do the same thing in Edge, forcing web devs to adapt to their bullshit.

Truly, they haven't learned their lesson. It's a shame, edge had such a good start and looked promising...

So if you have new laptop with precision touch pad and zooming pcb doesn't work for you on Edge, don't report it. I will not fix it, the above bug report and Microsoft's "fuck you, we know better" is your answer why.

qu1ck commented 6 years ago

@TechJA your last ask to lock highlighted row was implemented.

TechJA commented 6 years ago

@qu1ck , thanks!