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

Commit 771cdda

Browse files
authored
Merge pull request #1878 from montegoulding/bugfix-20783
[[ Bug 20783 ]] Import SVG from file menu
2 parents 4442e3f + 06d50ee commit 771cdda

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
@@ -7235,7 +7235,7 @@ function revIDEAcceptedTypes pType
72357235
local tTypes
72367236
switch pType
72377237
case "image"
7238-
return "jpg,jpeg,jfif,gif,png,bitmap,bmp,dib,vga,pict,pict2,pic"
7238+
return "jpg,jpeg,jfif,gif,png,bitmap,bmp,dib,vga,pict,pict2,pic,svg"
72397239
case "video"
72407240
put "mp4,mpg,mpeg,mov" into tTypes
72417241
if the platform is "win32" then
@@ -7331,7 +7331,12 @@ on revIDEImportControl pType, pFileName, pReferenced
73317331
set the defaultStack to tTargetStack
73327332
switch pType
73337333
case "image"
7334-
if pReferenced is true then
7334+
if pFileName ends with ".svg" then
7335+
-- SVG files can't be referenced
7336+
revIDECreateObject "com.livecode.interface.classic.image", tTargetStack, tCreatedControlLocation
7337+
put the long id of the last control into tCreatedControlID
7338+
set the text of tCreatedControlID to drawingSvgCompileFile(pFileName)
7339+
else if pReferenced is true then
73357340
## Create a classic image control with default properties
73367341
## Set the filename of the new image control to the referenced image
73377342
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)