Fixed deprecation warning about foreach index being implicitly converted from size_t to int

This commit is contained in:
Daniele Bondì 2020-02-29 22:36:24 +01:00
parent 1c592c4664
commit 1e67893256
2 changed files with 5 additions and 3 deletions

View File

@ -538,7 +538,7 @@ class FreeTypeFontManager : FontManager {
FontFileItem best = null;
int bestScore = 0;
string[] faces = face ? split(face, ",") : null;
foreach(int index, FontFileItem item; _fontFiles) {
foreach(size_t index, FontFileItem item; _fontFiles) {
int score = 0;
int bestFaceMatch = 0;
if (faces && face.length) {

View File

@ -3446,8 +3446,9 @@ class EditBox : EditWidgetBase {
rc.offset(0, yOffset);
Rect[] wrappedSelection;
wrappedSelection.length = curSpan.len;
foreach (int i, wrapLineRect; wrappedSelection)
foreach (size_t i_, wrapLineRect; wrappedSelection)
{
int i = cast(int)i_;
int startingDifference = rc.left - _clientRect.left;
wrapLineRect = rc;
wrapLineRect.offset(-1 * curSpan.accumulation(i, LineSpan.WrapPointInfo.Width), i * _lineHeight);
@ -3796,8 +3797,9 @@ class EditBox : EditWidgetBase {
wrappedLine = _span[i].wrappedContent;
int accumulativeLength;
CustomCharProps[] wrapProps;
foreach (int q, curWrap; wrappedLine)
foreach (size_t q_, curWrap; wrappedLine)
{
int q = cast(int)q_;
auto lineOffset = q + i + wrapsUpTo(i + _firstVisibleLine);
if (highlight)
{