Comments (2)
In this function
void ImBitmapFont::RenderText(
You can replace
const float s1 = (0.0f + glyph->X) * tex_scale_x;
const float t1 = (0.0f + glyph->Y) * tex_scale_y;
const float s2 = (0.0f + glyph->X + glyph->Width) * tex_scale_x;
const float t2 = (0.0f + glyph->Y + glyph->Height) * tex_scale_y;
With
const float s1 = (0.5f + glyph->X) * tex_scale_x;
const float t1 = (0.5f + glyph->Y) * tex_scale_y;
const float s2 = (0.5f + glyph->X + glyph->Width) * tex_scale_x;
const float t2 = (0.5f + glyph->Y + glyph->Height) * tex_scale_y;
I am currently investigating the right way to expose that because the offset depends on your rendering architecture.
from imgui.
I have commited a fix, added a 'float PixelCenterOffset' value in ImGuiIO which default to 0.5f (for OpenGL and DirectX 10+). The DirectX9 sample application sets it back to 0.0. Based on a suggestion by SimDietrich.
from imgui.
Related Issues (20)
- Color Discrepancy Between OpenCV and Photoshop Hue Adjustments HOT 2
- What is that "(?)" item that shows a popup when hovered over? HOT 5
- I want to pass a method function as the ImGuiInputResizeCallback HOT 3
- Would it be reasonable for functions that accept text_begin/text_end to allow text_begin equals text_end equals NULL? HOT 3
- Imgui version before using SDL versions higher than 2.0.2 HOT 5
- Consistent look across scale changes HOT 3
- Imgui build freezing on win10 but not win11 HOT 1
- ImGui Device Not Responding After Fullscreen Application Changes Resolution HOT 1
- Font atlas builder is off by one in some font configurations HOT 2
- Docking: SDL3 + DirectX(9/11) Resize wnd problem without main wnd HOT 1
- Capturing gamepad input only when my dear imgui window is focused
- Duplicate controls appearing in popup modal in latest version of cimgui-go wrapper. HOT 2
- Changing a widget box's position HOT 1
- multiply defined sscanf error in example_glfw_opengl3 HOT 5
- Random Intermittent Crash - perhaps triggered by imgui reading outside of viewport buffer? HOT 6
- How to setup hardware mouse cursor ? HOT 6
- InputText is not working HOT 1
- `PushStyleVar(StyleVar_DockingSeparatorSize)` mid-frame has no effect on docked windows
- Help! Program crashes after ImGui panel is dragged slightly off screen HOT 1
- Android 13+ DisplayFramebufferScale 渲染不正常
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imgui.