Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 06d50ee

Browse files
committed
[[ Bug 20783 ]] Import SVG from file menu
1 parent 1d4ab86 commit 06d50ee

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Toolset/libraries/revidelibrary.8.livecodescript

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7233,7 +7233,7 @@ function revIDEAcceptedTypes pType
72337233
local tTypes
72347234
switch pType
72357235
case "image"
7236-
return "jpg,jpeg,jfif,gif,png,bitmap,bmp,dib,vga,pict,pict2,pic"
7236+
return "jpg,jpeg,jfif,gif,png,bitmap,bmp,dib,vga,pict,pict2,pic,svg"
72377237
case "video"
72387238
put "mp4,mpg,mpeg,mov" into tTypes
72397239
if the platform is "win32" then
@@ -7329,7 +7329,12 @@ on revIDEImportControl pType, pFileName, pReferenced
73297329
set the defaultStack to tTargetStack
73307330
switch pType
73317331
case "image"
7332-
if pReferenced is true then
7332+
if pFileName ends with ".svg" then
7333+
-- SVG files can't be referenced
7334+
revIDECreateObject "com.livecode.interface.classic.image", tTargetStack, tCreatedControlLocation
7335+
put the long id of the last control into tCreatedControlID
7336+
set the text of tCreatedControlID to drawingSvgCompileFile(pFileName)
7337+
else if pReferenced is true then
73337338
## Create a classic image control with default properties
73347339
## Set the filename of the new image control to the referenced image
73357340
revIDECreateObject "com.livecode.interface.classic.image", tTargetStack, tCreatedControlLocation

notes/bugfix-20783.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Import SVG from IDE file menu

0 commit comments

Comments
 (0)