mirror of https://github.com/buggins/dlangui.git
Fix deprecations
This commit is contained in:
parent
36939cf0d5
commit
6bfb78e02d
|
@ -24,6 +24,7 @@ import dlangui.core.linestream;
|
||||||
import dlangui.core.streams;
|
import dlangui.core.streams;
|
||||||
import std.algorithm;
|
import std.algorithm;
|
||||||
import std.conv : to;
|
import std.conv : to;
|
||||||
|
import std.uni;
|
||||||
|
|
||||||
// uncomment FileFormats debug symbol to dump file formats for loaded/saved files.
|
// uncomment FileFormats debug symbol to dump file formats for loaded/saved files.
|
||||||
//debug = FileFormats;
|
//debug = FileFormats;
|
||||||
|
@ -1132,7 +1133,7 @@ class EditableContent {
|
||||||
/// inserts count empty lines at specified position
|
/// inserts count empty lines at specified position
|
||||||
protected void insertLines(int start, int count)
|
protected void insertLines(int start, int count)
|
||||||
in { assert(count > 0); }
|
in { assert(count > 0); }
|
||||||
body {
|
do {
|
||||||
_lines.length += count;
|
_lines.length += count;
|
||||||
_tokenProps.length = _lines.length;
|
_tokenProps.length = _lines.length;
|
||||||
_editMarks.length = _lines.length;
|
_editMarks.length = _lines.length;
|
||||||
|
|
|
@ -106,7 +106,7 @@ class SettingsFile {
|
||||||
|
|
||||||
static string limitString(string value, const string[] values)
|
static string limitString(string value, const string[] values)
|
||||||
in { assert(values.length > 0); }
|
in { assert(values.length > 0); }
|
||||||
body {
|
do {
|
||||||
foreach(v; values)
|
foreach(v; values)
|
||||||
if (v.equal(value))
|
if (v.equal(value))
|
||||||
return value;
|
return value;
|
||||||
|
|
|
@ -15,6 +15,7 @@ static if (ENABLE_FREETYPE):
|
||||||
import dlangui.graphics.fonts;
|
import dlangui.graphics.fonts;
|
||||||
|
|
||||||
import derelict.freetype.ft;
|
import derelict.freetype.ft;
|
||||||
|
import derelict.util.exception;
|
||||||
import dlangui.core.logger;
|
import dlangui.core.logger;
|
||||||
import dlangui.core.collections;
|
import dlangui.core.collections;
|
||||||
import std.algorithm;
|
import std.algorithm;
|
||||||
|
|
|
@ -49,6 +49,7 @@ version (Android) {
|
||||||
} else {
|
} else {
|
||||||
enum SUPPORT_LEGACY_OPENGL = false; //true;
|
enum SUPPORT_LEGACY_OPENGL = false; //true;
|
||||||
public import derelict.opengl;
|
public import derelict.opengl;
|
||||||
|
import derelict.util.exception;
|
||||||
//public import derelict.opengl.types;
|
//public import derelict.opengl.types;
|
||||||
//public import derelict.opengl.versions.base;
|
//public import derelict.opengl.versions.base;
|
||||||
//public import derelict.opengl.versions.gl3x;
|
//public import derelict.opengl.versions.gl3x;
|
||||||
|
|
|
@ -44,6 +44,7 @@ import derelict.sdl2.sdl;
|
||||||
static if (ENABLE_OPENGL) {
|
static if (ENABLE_OPENGL) {
|
||||||
//import derelict.opengl3.gl3;
|
//import derelict.opengl3.gl3;
|
||||||
import derelict.opengl;
|
import derelict.opengl;
|
||||||
|
import derelict.util.exception;
|
||||||
import dlangui.graphics.gldrawbuf;
|
import dlangui.graphics.gldrawbuf;
|
||||||
import dlangui.graphics.glsupport;
|
import dlangui.graphics.glsupport;
|
||||||
}
|
}
|
||||||
|
|
|
@ -384,7 +384,7 @@ class SimpleBarChart : Widget {
|
||||||
protected Point measureAxisYDesc() {
|
protected Point measureAxisYDesc() {
|
||||||
int maxDescWidth = _axisYMinDescWidth;
|
int maxDescWidth = _axisYMinDescWidth;
|
||||||
double currentMaxValue = _maxY;
|
double currentMaxValue = _maxY;
|
||||||
if (approxEqual(_maxY, 0, 0.0000001, 0.0000001))
|
if (isClose(_maxY, 0, 0.0000001, 0.0000001))
|
||||||
currentMaxValue = 100;
|
currentMaxValue = 100;
|
||||||
|
|
||||||
Point sz = font.textSize(to!dstring(currentMaxValue), MAX_WIDTH_UNSPECIFIED, 4, 0, textFlags);
|
Point sz = font.textSize(to!dstring(currentMaxValue), MAX_WIDTH_UNSPECIFIED, 4, 0, textFlags);
|
||||||
|
@ -400,7 +400,7 @@ class SimpleBarChart : Widget {
|
||||||
|
|
||||||
protected int barYValueToPixels(int axisInPixels, double barYValue ) {
|
protected int barYValueToPixels(int axisInPixels, double barYValue ) {
|
||||||
double currentMaxValue = _maxY;
|
double currentMaxValue = _maxY;
|
||||||
if (approxEqual(_maxY, 0, 0.0000001, 0.0000001))
|
if (isClose(_maxY, 0, 0.0000001, 0.0000001))
|
||||||
currentMaxValue = 100;
|
currentMaxValue = 100;
|
||||||
|
|
||||||
double pixValue = axisInPixels / currentMaxValue;
|
double pixValue = axisInPixels / currentMaxValue;
|
||||||
|
@ -464,7 +464,7 @@ class SimpleBarChart : Widget {
|
||||||
|
|
||||||
// segments on y axis and values (now only max and max/2)
|
// segments on y axis and values (now only max and max/2)
|
||||||
double currentMaxValue = _maxY;
|
double currentMaxValue = _maxY;
|
||||||
if (approxEqual(_maxY, 0, 0.0000001, 0.0000001))
|
if (isClose(_maxY, 0, 0.0000001, 0.0000001))
|
||||||
currentMaxValue = 100;
|
currentMaxValue = 100;
|
||||||
|
|
||||||
int yZero = rc.bottom - _axisX.maxDescriptionSize.y - _axisX.segmentTagLength - _axisX.thickness - _axisY.zeroValueDist;
|
int yZero = rc.bottom - _axisX.maxDescriptionSize.y - _axisX.segmentTagLength - _axisX.thickness - _axisY.zeroValueDist;
|
||||||
|
|
Loading…
Reference in New Issue