mirror of https://github.com/buggins/dlangui.git
fix glyph cache
This commit is contained in:
parent
dd13b36bc3
commit
b13be29407
|
|
@ -52,7 +52,10 @@ struct GlyphCache
|
|||
ushort p = glyphIndex >> 8;
|
||||
if (_glyphs[p] is null)
|
||||
return null;
|
||||
return &_glyphs[p][glyphIndex & 0xFF];
|
||||
ushort i = glyphIndex & 0xFF;
|
||||
if (_glyphs[p][i].glyphIndex == 0)
|
||||
return null;
|
||||
return &_glyphs[p][i];
|
||||
//if (_array[glyphIndex].glyphIndex)
|
||||
// return &_array[glyphIndex];
|
||||
//return null;
|
||||
|
|
|
|||
|
|
@ -159,10 +159,12 @@ class LayoutItems {
|
|||
// resize all if need to shrink or only resizable are too small to correct delta
|
||||
needForceResize = delta < 0 || resizableWeight == 0; // || resizableSize * 2 / 3 < delta; // do we need resize non-FILL_PARENT items?
|
||||
// calculate scale factor: weight / delta * 10000
|
||||
if (needForceResize)
|
||||
if (needForceResize && nonresizableSize + resizableSize > 0)
|
||||
scaleFactor = 10000 * delta / (nonresizableSize + resizableSize);
|
||||
else
|
||||
else if (resizableSize > 0)
|
||||
scaleFactor = 10000 * delta / resizableSize;
|
||||
else
|
||||
scaleFactor = 0;
|
||||
}
|
||||
//Log.d("VerticalLayout delta=", delta, ", nonres=", nonresizableWeight, ", res=", resizableWeight, ", scale=", scaleFactor);
|
||||
// find last resized - to allow fill space 1 pixel accurate
|
||||
|
|
|
|||
Loading…
Reference in New Issue