Made changes to screenshot handling.
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user