Skip to content

Commit

Permalink
Yutils: tonumber(ffi.C.wcslen()) (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akatmks committed Jun 25, 2023
1 parent 5860531 commit 91a4ac7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Yutils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3171,7 +3171,7 @@ Yutils = {
end
-- Get utf16 text
text = utf8_to_utf16(text)
local text_len = ffi.C.wcslen(text)
local text_len = tonumber(ffi.C.wcslen(text))
-- Get text extents with this font
local size = ffi.new("SIZE[1]")
ffi.C.GetTextExtentPoint32W(dc, text, text_len, size)
Expand All @@ -3190,7 +3190,7 @@ Yutils = {
local shape, shape_n = {}, 0
-- Get utf16 text
text = utf8_to_utf16(text)
local text_len = ffi.C.wcslen(text)
local text_len = tonumber(ffi.C.wcslen(text))
-- Add path to device context
if text_len > 8192 then
error("text too long", 2)
Expand Down Expand Up @@ -3531,4 +3531,4 @@ if ({...})[1] then
end

-- Return library to script loader
return Yutils
return Yutils

0 comments on commit 91a4ac7

Please sign in to comment.