Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AV error after setting SVGText in TSVGIconImage #227

Open
birbilis opened this issue Apr 1, 2022 · 5 comments
Open

AV error after setting SVGText in TSVGIconImage #227

birbilis opened this issue Apr 1, 2022 · 5 comments

Comments

@birbilis
Copy link
Contributor

birbilis commented Apr 1, 2022

Got this even though icon was set ok (think I got it one or twice, not sure if IDE issue or not)
image

@birbilis
Copy link
Contributor Author

birbilis commented Apr 1, 2022

Btw, I was trying to set that image again (accidentally in the screenshot above I was trying to set it at my base TStoryItem class instead of at the descendent TImageStoryItem, those are from https://github.com/zoomicon/READCOM_App). I noticed if I set the SVGText to the Glyph object I have there (of TSVGIconImage type) at a descendent frame (say in TAudioStoryItem) upon pressing Save in Delphi for the TFrame file, it clears the SVG from the display (and loses it). Not sure if it's something I'm doing wrong in my base frame constructor, it was working till recently and think it broke (lost the SVG images at descendent frames) upon updating your library from GetIt.

So, have you tried if your TSVGIconImage stores its SVGText state ok when it is used with Frame inheritance (aka set at a descendent frame)?

@birbilis
Copy link
Contributor Author

birbilis commented Apr 1, 2022

so if I edit my .fmx of the inherited frame (TAudioStoryItem, descending from TStoryItem) by hand and open it, shows OK, but pressing save again it replaces SVGText with ''. The ancestor (the TStoryItem) has Glyph's SVGText as '' instead (the property editor doesn't seem to be able to set an empty string/file). So load when using frame inheritance works, but save somehow fails (instantly replaces SVGText with '')

inherited AudioStoryItem: TAudioStoryItem
Size.Width = 232.000000000000000000
Size.Height = 204.000000000000000000
OnClick = FrameClick
inherited Glyph: TSVGIconImage
Opacity = 0.300000011920929000
Size.Width = 232.000000000000000000
Size.Height = 204.000000000000000000
SVGText =
''#10'<svg xmln' +
's:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http:' +
'//www.w3.org/2000/svg" xmlns:cc="http://web.resource.org/cc/" xm' +
'lns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.o' +
'rg/dc/elements/1.1/" id="Layer_1" enable-background="new 0 0 100' +
' 100" xml:space="preserve" viewBox="0 0 100 100" version="1.1" y' +
'="0px" x="0px">'#10' '#10''#10
end
inherited Border: TRectangle
Size.Width = 232.000000000000000000
Size.Height = 204.000000000000000000
end
object MediaPlayer: TMediaPlayerEx
FileName = ''
Muted = False
AutoPlaying = False
Looping = False
Left = 26
Top = 50
end
end

@birbilis
Copy link
Contributor Author

birbilis commented Apr 3, 2022

update: also just noticed that if I save an even deeper descendent frame than the one where I set the SVGText property of the TSVGIconImage that had been inherited from parent frame, it saves ok. It only fails (clears the SVGText) if I press Save in the frame that defined the SVGText (as I said that is a descendent frame of the one where TSVGIconImage component was defined)

If I add by hand in the .fmx file the SVGText it works ok.

Also note before I had that SVGText in the child Multires bitmap and it was saving ok, but after upgrade to new version it lost that data. You may be missing some call to "inherited" if you define persisted content programmatically / on-the-fly

@carloBarazzetta
Copy link
Contributor

Is this problem also present? I don't use Android apps as extensively as you do, so I can't reproduce the problem...

@birbilis
Copy link
Contributor Author

birbilis commented Aug 5, 2023

Not related to Android, but to frame inheritance. You may have forgotten to call inherited if you’ve overriden the persistence calls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants