Flameshot: Counter bubble sometimes adds cropped values

Created on 14 Sep 2020  路  14Comments  路  Source: flameshot-org/flameshot

_Originally posted by @aivchen in https://github.com/flameshot-org/flameshot/issues/884#issuecomment-691821512_

Glad to see that the project is alive again!
An auto-incrementing counter bubble sometimes adds cropped values: https://i.imgur.com/J3Nqd3m.png

@aivchen what OS do you use, and how did you install Flameshot?

image

Bug Waiting For Info

Most helpful comment

@mmahmoudian

1.) I think it would be better to scale down the font to fit in the bubble so the outer size is consistent. I think there is a way to do this without too much trouble.

3.) I thought about this when I was coding it, and I can't imagine ever using flameshot to make over 99 bubbles, Since we don't support dragging features once they are placed it would be a nightmare to try to use flameshot with that many assets.

All 14 comments

I bet in monospace font the behavior is more consistent (either consistently cropped or consistently correct). I can extrapolate that with the current system, the three-digit bubbles are impossible. For this we have the following solutions:

  1. The radius of the circle gets changed by the width of the string (or alternatively we circle turn into an oval shape by elongating the horizontal axis)
  2. we always use monospace font
  3. we put a cap on the max of the number.

@mmahmoudian

1.) I think it would be better to scale down the font to fit in the bubble so the outer size is consistent. I think there is a way to do this without too much trouble.

3.) I thought about this when I was coding it, and I can't imagine ever using flameshot to make over 99 bubbles, Since we don't support dragging features once they are placed it would be a nightmare to try to use flameshot with that many assets.

@mmahmoudian and @aivchen can you try the appimage from this PR #917 I think this will resolve the issue. It even fixes it over 99 because it will rescale the font to fit the bubble:
image

@aivchen To save you some time, the following is the AppImage:
https://we.tl/t-9JitQFf3a1

@borgmanJeremy it works, but it occurred to me that the size of the bubbles should not be 0 and it should start from 6 or 7:

image

@mmahmoudian The issue is all sizes in all of flameshot use one shared variable. This is something we likely will refactor in 0.9 and keep a unique thickness per tool, but until that refactoring it is not really possible.

But how about for now we add +6 to "counter bubble" size? no if statement is needed. This would make sure that when global size goes to 0, the bubble size would stay at 6.

Then in the 0.9 we can properly solve the issue.

I think it would be better to just (in pseudo code)

if (shared_thickness < 6)
   bubble_thickness = 6
else()
  bubble_thickess = shared_thickness

Then users who want a very specific thickness (for example to match the size of other tools) will not be confused.

917 Is updated with minimum bubble size if you want to check @mmahmoudian

@borgmanJeremy I think the minimum is still very small, also the text cropping seems to be there:
image

What is your font so I can test local?

Yes, I still have cropped numbers.
image

Also, I have the following output in the console (I hope this can help):

andrew@andrew-pc /tmp> ./Flameshot-0.8.0-x86_64.AppImage
Run experimental self-contained bundle
Fontconfig warning: "/etc/fonts/conf.avail/05-reset-dirs-sample.conf", line 6: unknown element "reset-dirs"
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile)
No XVisualInfo for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile)
Falling back to using screens root_visual.
QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::setCompositionMode: Painter not active
QPainter::translate: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::setBrush: Painter not active

What is your font so I can test local?

How can I find the font I'm using?

@aivchen @mmahmoudian Apologies, in my rush I pushed the wrong commits. It should work now (it at least does locally).

@borgmanJeremy @mmahmoudian Everything works fine now. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

soundsbeard picture soundsbeard  路  4Comments

ElijahLynn picture ElijahLynn  路  3Comments

dajare picture dajare  路  4Comments

orschiro picture orschiro  路  3Comments

hosiet picture hosiet  路  4Comments