TrilbyWhite / Slider

PDF presentation tool
GNU General Public License v3.0
54 stars 12 forks source link

Zoom and action boxes not at right position when screen ratio != pdf ratio #21

Closed thamnos closed 9 years ago

thamnos commented 10 years ago

When looking at a 4:3 pdf on a 16:9 screen, the pdf content is positioned correctly in the middle of the screen. However, boxes around links and the regions that are zoomed are misplaced: On the left of the screen, they are too far left and on the right they are too far right. I believe that this happens because these coordinates are not scaled appropriately.

TrilbyWhite commented 10 years ago

Yes, I recently noticed this. I just changed the scaling: it used to fit any pdf to the screen, now the slides are scaled to fit the screen while maintaining the aspect ratio of the original pdf (so there are black bars on the side). This was a recent change - and I have yet to get the rectangle drawing functions up to date. Thanks for the reminder.

TrilbyWhite commented 10 years ago

I've just pushed a revision which includes the fix for zooming. I still have to patch up the action/links function, but that should be coming in the next couple of days.

thamnos commented 10 years ago

Cheers! I think actions.c line 319 probably needs to be: cairo_translate(ctx, (show->dx - x1)/show->scale, (show->dy - y1)/show->scale); Sorry I didn't figure out how to push this directly to github...

TrilbyWhite commented 10 years ago

Hmm, not quite that either. It seems the code I have up works perfectly with some of my pdfs, but is completely wrong with others (even when they are of very similar size).

Crap - I figured out why I couldn't test this: I have a pdf with different sized pages. Now I have to figure out whether or not slider should be able to deal with differently sized pages.

TrilbyWhite commented 10 years ago

Ok now zooming should really be fixed. Action links have yet to be tackled.

thamnos commented 10 years ago

Hmmm... still doesn't work for me. I think that maybe the line if (!conf.lock_aspect) cairo_scale(ctx, scx, scy); should be executed in any case, i.e. remove the if....

Personally, I think a pdf with differently sized pages is fairly uncommon for presentations, isn't it?

TrilbyWhite commented 10 years ago

Yes, but pdfs that aren't 4:3 aspect ratio are also uncommon for presentations - but that's what all the lock aspect ratio stuff is for.

Focusing on the more common cases is good, but I can't have slider completely choke on rare cases.

TrilbyWhite commented 10 years ago

OK, I'm pretty sure I've really got this this time, please let me know if the most recent revision works on your end.

thamnos commented 10 years ago

I don't see yellow frames around the action links but the zooming seems to work just fine.

TrilbyWhite commented 10 years ago

I've not reimplemented the yellow frames - I'm not sure I want to. I think the change in mouse cursor is signal enough. If I reimplement it, I'll probably change it so there isn't a yellow box, but rather a different visual que when the mouse is hovered over a link (maybe fade all the slide except for the current link ...)

TrilbyWhite commented 9 years ago

I've just moved version 4 to the master branch - and zooming works completely differently. So this issue is only relevant to the v3 branch which I don't intend to update further - though you can feel free to submit pull requests or patches for v3 if that is of value to you.