-Hid texture flags by default so they dont take so much space

-make curve texture preview not so large, so its easier to embed the editor
This commit is contained in:
Juan Linietsky 2018-05-18 12:37:18 -03:00
parent 5e997c9483
commit 9b5275b135
2 changed files with 4 additions and 2 deletions

View file

@ -794,13 +794,13 @@ Ref<Texture> CurvePreviewGenerator::generate(const Ref<Resource> &p_from) {
img_ref.instance(); img_ref.instance();
Image &im = **img_ref; Image &im = **img_ref;
im.create(thumbnail_size, thumbnail_size, 0, Image::FORMAT_RGBA8); im.create(thumbnail_size, thumbnail_size / 2, 0, Image::FORMAT_RGBA8);
im.lock(); im.lock();
Color bg_color(0.1, 0.1, 0.1, 1.0); Color bg_color(0.1, 0.1, 0.1, 1.0);
for (int i = 0; i < thumbnail_size; i++) { for (int i = 0; i < thumbnail_size; i++) {
for (int j = 0; j < thumbnail_size; j++) { for (int j = 0; j < thumbnail_size / 2; j++) {
im.set_pixel(i, j, bg_color); im.set_pixel(i, j, bg_color);
} }
} }

View file

@ -76,7 +76,9 @@ void Texture::_bind_methods() {
ClassDB::bind_method(D_METHOD("draw_rect_region", "canvas_item", "rect", "src_rect", "modulate", "transpose", "normal_map", "clip_uv"), &Texture::draw_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(true)); ClassDB::bind_method(D_METHOD("draw_rect_region", "canvas_item", "rect", "src_rect", "modulate", "transpose", "normal_map", "clip_uv"), &Texture::draw_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(true));
ClassDB::bind_method(D_METHOD("get_data"), &Texture::get_data); ClassDB::bind_method(D_METHOD("get_data"), &Texture::get_data);
ADD_GROUP("Flags", "");
ADD_PROPERTY(PropertyInfo(Variant::INT, "flags", PROPERTY_HINT_FLAGS, "Mipmaps,Repeat,Filter,Anisotropic Linear,Convert to Linear,Mirrored Repeat,Video Surface"), "set_flags", "get_flags"); ADD_PROPERTY(PropertyInfo(Variant::INT, "flags", PROPERTY_HINT_FLAGS, "Mipmaps,Repeat,Filter,Anisotropic Linear,Convert to Linear,Mirrored Repeat,Video Surface"), "set_flags", "get_flags");
ADD_GROUP("", "");
BIND_ENUM_CONSTANT(FLAGS_DEFAULT); BIND_ENUM_CONSTANT(FLAGS_DEFAULT);
BIND_ENUM_CONSTANT(FLAG_MIPMAPS); BIND_ENUM_CONSTANT(FLAG_MIPMAPS);