WIP Borders applied only to diffuse textures
#1
Previously, you could have an image element with a border specified. This was okay for buttons with featureless textures, but for thumbnails and similar assets. To have a good looking border, a fairly large diffuse texture would have to be made.

This pending PR (https://github.com/xbmc/xbmc/pull/21552) adds the option to slice only the diffuse texture, while leaving the primary texture intact.

Before the change:
Image

After:
Image

This was done by adding the "sliceonlydiffuse" attribute. Here is an example:
xml:
<control type="image">
  <left>4</left>
  <top>0</top>
  <aspectratio>keep</aspectratio>
  <width>400</width>
  <height>400</height>
  <texture border="40" sliceonlydiffuse="true" diffuse="buttons/dialogbutton-fo.png">DefaultAudioDSP.png</texture>
</control>

Test-Builds:
Win32 http://mirrors.kodi.tv/test-builds/windo...ng-x86.exe
Win64 http://mirrors.kodi.tv/test-builds/windo...ng-x64.exe
Reply
#2
Just tried the x64 version and I can't seem to get it to work.

I'm using a 128x128 diffuse texture with a corner radius of 32 pixels, this is my image control and this is the result:-

Code:
        <control type="image">
            <top>100</top>
            <left>350</left>
            <width>400</width>
            <height>600</height>
            <texture border="32" sliceonlydiffuse="true" diffuse="masks/128x128r32.png">general/poster.jpg</texture>
        </control>

Image
Reply
#3
So in my first test the poster image was 2000x3000 pixel after scaling the poster down to the same size as the image control 400x600 I get this:-

Image

The diffuse isn't being sliced or scaled correctly.
Reply
#4
Confirming not working as expected (but will be amazing once it is!)

I added some comments on the PR. I think the issue lies with the border attribute not being applied to the diffuse texture before stretching/scaling.

In normal usage, the border attribute only ever applies to the main texture not the diffuse. To achieve the effect we are after, we need a way to apply a border attribute to the diffuse texture instead of the main texture. Ideally it would be an independent border attribute that only applies to the diffuse e.g. diffuseborder=""
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#5
@sarbes Any update on this, are you still working on it?

Thanks
Reply
#6
Yeah. I've done some changes, it should work now. Jenkins was a bit iffy lately, so I have no build. I'll do some test builds when I have time.
Reply
#7
That's great, thanks.
Reply
#8
@roidy New x64 build: http://mirrors.kodi.tv/test-builds/windo...ng-x64.exe

Jenkins doesn't build Win32 atm. If you do need a 32 Bit build, feel free to ask.
Reply
#9
@sarbes Thanks, that works perfectly. This is a great addition to the skinning engine.
Reply
#10
https://github.com/xbmc/xbmc/pull/21552

@sarbes What's the eta on this getting merged?
Reply
#11
When it is ready.
Reply
#12
Ok, I didn't realise it wasn't ready yet.
Reply
#13
Look, I don't have much time at the moment and my workstation is down. It is currently not convenient for me to do the finishing touches. Also, I'm doing everything on my own pace.

The work left is relatively minor, the biggest part would be evaluating the patch, which takes around two hours.
Reply
#14
(2022-08-21, 18:28)sarbes Wrote: Look, I don't have much time at the moment and my workstation is down. It is currently not convenient for me to do the finishing touches. Also, I'm doing everything on my own pace.

I completely understand..... I know people work on Kodi in their free time and they have lives and other responsibilities. It wasn't my intention to pressure you in any way.
Reply

Logout Mark Read Team Forum Stats Members Help
Borders applied only to diffuse textures0