glutanimate / puppy-reinforcement

Puppy Reinforcement add-on for Anki
https://ankiweb.net/shared/info/1722658993
Other
15 stars 9 forks source link

Images Are Getting Cropped, Cards Not Showing #22

Open AnkiUserS opened 3 years ago

AnkiUserS commented 3 years ago

Problem description

When I set the image size to about 400px or higher, the images and pop-up text-boxes are cropped at the bottom. Moreover, wide images and text-boxes are cropped on the right. And often times after an image is shown, even after pressing space, the next card is not displayed. It just continues to show the card I just answered. Then when I press space again, the answer of the next card is shown instead of the question, so instead of being shown cards, I'm just shown the answers. This is in the newest version of Puppy Reinforcement.

When I run a legacy version on Anki 2.0.52, wide images are cropped on the right, but otherwise everything works as intended. The problems also do not go away when I run older versions of Anki 2.1. I've tried 2.1.40 and 2.1.15. These problems are still present when running no other add-ons, and when I launch Anki when holding shift, there are no issues of cards not showing up properly.

Also, I use a 4000 millisecond display time, and a bunch of custom images, some of which are very high resolution.

Checklist

Please replace the space inside the brackets with an x if the following items apply:

Information about your Anki set-up

I'm running Anki 2.1.43 on MacOS. This occurs both on my 1280x800 and 1920x1080 screens.

If you are using Anki 2.1

Please open Anki, go to Help → About, click on "Copy Debug Info", and paste the result between the backticks below (if the button does not appear you are using an older version of Anki 2.1 and will need to update first):

Error message (if any)

If you've received an error message, please copy and paste it between the backticks below:

antarticwind commented 2 years ago

I have the same problem, an it seems the reason is the same as in "#1 [Puppy Reinforcement] IMAGE_HEIGHT not scaling images properly"

Is there a way to change this? I would love to use bigger images

LuckLustre commented 2 years ago

So, fiddled with it for a bit and figured it out. Go into your add-ons list and select "Puppy Reinforcement." Then, click on "View Files." Open the "tooltip.py" file in a text editor. Go down and find the line: "lab.move(aw.mapToGlobal(QPoint(0, -260 - vdiff + aw.height()))) # type:ignore" this controls where the little window pops up. I played around with this until I found the coordinates that worked for me, which was changing it to "lab.move(aw.mapToGlobal(QPoint(20, -360 - vdiff + aw.height()))) # type:ignore." Then, when you are done with your editing, save the file and restart Anki. Hope this helps.