Made changes to screenshot handling.

This commit is contained in:
Jakob Friedl
2025-10-14 21:05:36 +02:00
parent 21137f6db5
commit df04eafc13
6 changed files with 32 additions and 15 deletions

View File

@@ -5,7 +5,7 @@ import ../fonticon/IconsFontAwesome6
#--------------
#--- zoomGlass
#--------------
proc zoomGlass*(textureID: var uint32, itemWidth:int, itemPosTop, itemPosEnd:ImVec2 , capture = false) =
proc zoomGlass*(textureID: var uint32, itemWidth:int, itemPosTop, itemPosEnd:ImVec2 , capture = false, zoom: float = 4.0f) =
# itemPosTop and itemPosEnd are absolute position in main window.
if igBeginItemTooltip():
defer: igEndTooltip()
@@ -23,7 +23,6 @@ proc zoomGlass*(textureID: var uint32, itemWidth:int, itemPosTop, itemPosEnd:ImV
let region_sz = 32.0f
var region_x = pio.MousePos.x - itemPosTop.x - region_sz * 0.5f
var region_y = pio.MousePos.y - itemPosTop.y - region_sz * 0.5f
let zoom = 4.0f
if region_x < 0.0f:
region_x = 0.0f
elif region_x > (my_tex_w - region_sz):

View File

@@ -126,7 +126,7 @@ proc draw*(component: ScreenshotsComponent, showComponent: ptr bool, connection:
let texture = component.textures[item.path]
igImage(ImTextureRef(internal_TexData: nil, internal_TexID: texture.textureId), vec2(texture.width, texture.height), vec2(0, 0), vec2(1, 1))
else:
igText("Select item for preview.")
igEndChild()

View File

@@ -104,6 +104,9 @@ proc draw*(component: ListenerModalComponent): UIListener =
else:
for host in callbackHosts.splitLines():
if host.isEmptyOrWhitespace():
continue
hosts &= ";"
let hostParts = host.split(":")
if hostParts.len() == 2: