rohanpm / qingfanyi

Interactive Chinese to English dictionary lookup tool for Linux desktops
GNU General Public License v3.0
0 stars 1 forks source link

Fallback when getting character extents fails #12

Open rohanpm opened 8 years ago

rohanpm commented 8 years ago

It would be a good idea to have some fallback mode in the case that the bounding box of text can't be calculated.

The main reason for this is that getCharacterExtents is broken in qt-at-spi prior to 0.4.0 (which is not widely available at the moment). Therefore, if there's no fallback, this program will be completely unusable against Qt4 applications on most systems.

rohanpm commented 8 years ago

Fallback mode should also be used when the character extents are obviously wrong (e.g. overlapping). Unfortunately this seems common, e.g. in terminal emulators.