Fix deprecations

This commit is contained in:
Grim Maple 2022-04-16 13:47:30 +03:00
parent 36939cf0d5
commit 6bfb78e02d
6 changed files with 9 additions and 5 deletions

View File

@ -24,6 +24,7 @@ import dlangui.core.linestream;
import dlangui.core.streams;
import std.algorithm;
import std.conv : to;
import std.uni;
// uncomment FileFormats debug symbol to dump file formats for loaded/saved files.
//debug = FileFormats;
@ -1132,7 +1133,7 @@ class EditableContent {
/// inserts count empty lines at specified position
protected void insertLines(int start, int count)
in { assert(count > 0); }
body {
do {
_lines.length += count;
_tokenProps.length = _lines.length;
_editMarks.length = _lines.length;

View File

@ -106,7 +106,7 @@ class SettingsFile {
static string limitString(string value, const string[] values)
in { assert(values.length > 0); }
body {
do {
foreach(v; values)
if (v.equal(value))
return value;

View File

@ -15,6 +15,7 @@ static if (ENABLE_FREETYPE):
import dlangui.graphics.fonts;
import derelict.freetype.ft;
import derelict.util.exception;
import dlangui.core.logger;
import dlangui.core.collections;
import std.algorithm;

View File

@ -49,6 +49,7 @@ version (Android) {
} else {
enum SUPPORT_LEGACY_OPENGL = false; //true;
public import derelict.opengl;
import derelict.util.exception;
//public import derelict.opengl.types;
//public import derelict.opengl.versions.base;
//public import derelict.opengl.versions.gl3x;

View File

@ -44,6 +44,7 @@ import derelict.sdl2.sdl;
static if (ENABLE_OPENGL) {
//import derelict.opengl3.gl3;
import derelict.opengl;
import derelict.util.exception;
import dlangui.graphics.gldrawbuf;
import dlangui.graphics.glsupport;
}

View File

@ -384,7 +384,7 @@ class SimpleBarChart : Widget {
protected Point measureAxisYDesc() {
int maxDescWidth = _axisYMinDescWidth;
double currentMaxValue = _maxY;
if (approxEqual(_maxY, 0, 0.0000001, 0.0000001))
if (isClose(_maxY, 0, 0.0000001, 0.0000001))
currentMaxValue = 100;
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 ) {
double currentMaxValue = _maxY;
if (approxEqual(_maxY, 0, 0.0000001, 0.0000001))
if (isClose(_maxY, 0, 0.0000001, 0.0000001))
currentMaxValue = 100;
double pixValue = axisInPixels / currentMaxValue;
@ -464,7 +464,7 @@ class SimpleBarChart : Widget {
// segments on y axis and values (now only max and max/2)
double currentMaxValue = _maxY;
if (approxEqual(_maxY, 0, 0.0000001, 0.0000001))
if (isClose(_maxY, 0, 0.0000001, 0.0000001))
currentMaxValue = 100;
int yZero = rc.bottom - _axisX.maxDescriptionSize.y - _axisX.segmentTagLength - _axisX.thickness - _axisY.zeroValueDist;