Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text positioning issue in TextBlock2D #838

Open
ganimtron-10 opened this issue Aug 11, 2023 · 1 comment
Open

Text positioning issue in TextBlock2D #838

ganimtron-10 opened this issue Aug 11, 2023 · 1 comment

Comments

@ganimtron-10
Copy link
Contributor

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

  • Simplest reference program
from fury import ui, window

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

  • 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
Copy link

Preetam-Das26 commented Jan 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants