fury-gl / fury

FURY - Free Unified Rendering in pYthon.
https://fury.gl
Other
241 stars 181 forks source link

Text positioning issue in `TextBlock2D` #838

Open ganimtron-10 opened 1 year ago

ganimtron-10 commented 1 year ago

Description

The TextBlock2D has an issue with the text positioning. If we scale a TextBlock2D to be completely visible we would be able to clearly notice that the text touches the top of the background boundary. To fix this we tried adjusting the text actors position at #837 but that wasn't a correct way as we only need that to be done when auto_font_scale is set to True. We also tried reducing the Bounding box size of the textactor to 95 percent but still the issue persists that we need to offset the text a bit to make the text placed at center. This issue needs a bit of thinking and discussion as the TextBlock2D being a core part needs to be changed effectively so that it doesn't harm any other related component. So, for now we create this issue as a remainder to what all things we have discovered and where we stopped so we could continue from here on!

Way to reproduce

tb = ui.TextBlock2D(size=(300, 150), bg_color=(0.5, 0.5, 0.5), auto_font_scale=True, text="HI") sm = window.ShowManager() sm.scene.add(tb) sm.start()


- Issue image
![image](https://github.com/fury-gl/fury/assets/64432063/f20d7b04-83a5-4f0a-af3a-daddd75ef065)

- System Information

{'fury_version': '0+unknown', 'pkg_path': 'D:\FuryWorkspace\fury\fury', 'commit_hash': 'b29a518a', 'sys_version': '3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)]', 'sys_executable': 'D:\FuryWorkspace\fury-env\Scripts\python.exe', 'sys_platform': 'win32', 'numpy_version': '1.22.4', 'scipy_version': '1.8.1', 'vtk_version': '9.1.0', 'matplotlib_version': '3.5.2', 'dipy_version': '1.5.0'}

Preetam-Das26 commented 8 months ago

Hi I am a beginner .I want to work on this issue.This might be my first contribution.So it would be great if you could give some tips for starting. @ganimtron-10