Skip to content

Commit

Permalink
fix RenderText cpu_fine_clip char_rect
Browse files Browse the repository at this point in the history
  • Loading branch information
zhobo63 committed Aug 12, 2024
1 parent aff1513 commit 92d966a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11,862 deletions.
6 changes: 4 additions & 2 deletions imgui/imgui_user.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,12 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
//x=ceilf(x);
//y=ceilf(y);
ImVec2 px((x+glyph->X0), (y+glyph->Y0));
ImVec2 ps(px.x + glyph->X1, px.y + glyph->Y1);
if(cpu_fine_clip && !InRect(px, ps, clip_rect)) {
ImVec2 py((x+glyph->AdvanceX), (y+FontSize));

if(cpu_fine_clip && !InRect(px, py, clip_rect)) {

}else {
ImVec2 ps(px.x + glyph->X1, px.y + glyph->Y1);
ImVec2 uv0(glyph->U0, glyph->V0);
ImVec2 uv1(glyph->U1, glyph->V1);
draw_list->AddImage(glyph->TexID, px, ps, uv0, uv1, col);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zhobo63/imgui-ts",
"version": "0.1.44",
"version": "0.1.45",
"description": "JavaScript bindings for Dear ImGui using Emscripten and TypeScript, modulized with webpack from imgui-js",
"main": "./src/index",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/bind-imgui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as ImGui_Impl from "./imgui_impl"

export {ImGui, ImGui_Impl}

export const version="0.1.44";
export const version="0.1.45";

export function ImGuiObject(obj:any, id:number=0):number
{
Expand Down
Loading

0 comments on commit 92d966a

Please sign in to comment.