mirror of https://github.com/buggins/dlangui.git
get borders from drawables' cache
This commit is contained in:
parent
8a5152c5c2
commit
0f0bbe4f53
|
@ -1134,21 +1134,14 @@ class StateDrawable : Drawable {
|
||||||
class CombinedDrawable : Drawable {
|
class CombinedDrawable : Drawable {
|
||||||
|
|
||||||
DrawableRef background;
|
DrawableRef background;
|
||||||
Drawable border;
|
DrawableRef border;
|
||||||
|
|
||||||
this(uint backgroundColor, string backgroundImageId, string borderDescription) {
|
this(uint backgroundColor, string backgroundImageId, string borderDescription) {
|
||||||
background =
|
background =
|
||||||
(backgroundImageId !is null) ? drawableCache.get(backgroundImageId) :
|
(backgroundImageId !is null) ? drawableCache.get(backgroundImageId) :
|
||||||
(!backgroundColor.isFullyTransparentColor) ? new SolidFillDrawable(backgroundColor) :
|
(!backgroundColor.isFullyTransparentColor) ? new SolidFillDrawable(backgroundColor) :
|
||||||
new EmptyDrawable;
|
new EmptyDrawable;
|
||||||
border = borderDescription !is null ? createColorDrawable(borderDescription) : new EmptyDrawable;
|
border = borderDescription !is null ? drawableCache.get(borderDescription) : new EmptyDrawable;
|
||||||
}
|
|
||||||
|
|
||||||
~this() {
|
|
||||||
destroy(background);
|
|
||||||
destroy(border);
|
|
||||||
background = null;
|
|
||||||
border = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override void drawTo(DrawBuf buf, Rect rc, uint state = 0, int tilex0 = 0, int tiley0 = 0) {
|
override void drawTo(DrawBuf buf, Rect rc, uint state = 0, int tilex0 = 0, int tiley0 = 0) {
|
||||||
|
|
Loading…
Reference in New Issue