|
|
|
|
|
|
using System; |
|
|
|
using UIWidgets.ui; |
|
|
|
using System.Collections.Generic; |
|
|
|
using UnityEngine; |
|
|
|
using Canvas = UIWidgets.ui.Canvas; |
|
|
|
using Rect = UIWidgets.ui.Rect; |
|
|
|
|
|
|
|
namespace UIWidgets.painting { |
|
|
|
/// How to paint any portions of a box not covered by an image.
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public static class DecorationImageUtil { |
|
|
|
public static void paintImage(Canvas canvas, Rect rect, ui.Image image) { |
|
|
|
canvas.drawImageRect(Rect.fromLTWH(0, 0, 100, 100), rect, new Paint(), image); |
|
|
|
} |
|
|
|
// todo refine logic below, no just draw in Rect(0, 0, 100, 100) for testing widgets
|
|
|
|
/* |
|
|
|
public static void paintImage(Canvas canvas, Rect rect, ui.Image image, BoxFit fit, Rect centerSlice, |
|
|
|
public static void paintImage( |
|
|
|
Canvas canvas, |
|
|
|
Rect rect, |
|
|
|
ui.Image image, |
|
|
|
// ColorFilter colorFileter,
|
|
|
|
BoxFit fit, |
|
|
|
Rect centerSlice, |
|
|
|
ImageRepeat repeat = ImageRepeat.noRepeat) { |
|
|
|
ImageRepeat repeat = ImageRepeat.noRepeat |
|
|
|
// bool flipHorizontally = false
|
|
|
|
) { |
|
|
|
if (rect.isEmpty) |
|
|
|
return; |
|
|
|
alignment = alignment ?? Alignment.center; |
|
|
|
|
|
|
|
|
|
|
if (needSave) |
|
|
|
canvas.restore(); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
|
|
|
|
public static List<Rect> _generateImageTileRects(Rect outputRect, Rect fundamentalRect, |
|
|
|
ImageRepeat repeat) { |
|
|
|