Browse Source

Remove repeat mode and texture position/size from tiled decorators

Michael Ragazzon 6 years ago
parent
commit
89bda4ab01

+ 5 - 5
Samples/basic/demo/data/demo.rml

@@ -139,11 +139,11 @@ button:focus {
 .fit-cover      { decorator: image( icon-invader cover      ); }
 .fit-cover      { decorator: image( icon-invader cover      ); }
 .fit-scale-none { decorator: image( icon-invader scale-none ); }
 .fit-scale-none { decorator: image( icon-invader scale-none ); }
 .fit-scale-down { decorator: image( icon-invader scale-down ); }
 .fit-scale-down { decorator: image( icon-invader scale-down ); }
-.transform.fit-fill       { decorator: image( icon-invader fill       rotate-90 ); }
-.transform.fit-contain    { decorator: image( icon-invader contain    rotate-90 ); }
-.transform.fit-cover      { decorator: image( icon-invader cover      rotate-90 ); }
-.transform.fit-scale-none { decorator: image( icon-invader scale-none rotate-90 ); }
-.transform.fit-scale-down { decorator: image( icon-invader scale-down rotate-90 ); }
+.transform.fit-fill       { decorator: image( icon-invader rotate-90 fill       ); }
+.transform.fit-contain    { decorator: image( icon-invader rotate-90 contain    ); }
+.transform.fit-cover      { decorator: image( icon-invader rotate-90 cover      ); }
+.transform.fit-scale-none { decorator: image( icon-invader rotate-90 scale-none ); }
+.transform.fit-scale-down { decorator: image( icon-invader rotate-90 scale-down ); }
 p.emojis
 p.emojis
 {
 {
 	text-align: left;
 	text-align: left;

+ 21 - 146
Source/Core/DecoratorTiled.cpp

@@ -49,17 +49,11 @@ static const Vector2f oriented_texcoords[6][2] = {{Vector2f(0, 0), Vector2f(1, 1
 													   {Vector2f(1, 0), Vector2f(0, 1)},
 													   {Vector2f(1, 0), Vector2f(0, 1)},
 													   {Vector2f(0, 1), Vector2f(1, 0)}};
 													   {Vector2f(0, 1), Vector2f(1, 0)}};
 
 
-DecoratorTiled::Tile::Tile() : position(0, 0), size(1, 1)
+DecoratorTiled::Tile::Tile() : position(0, 0), size(0, 0)
 {
 {
 	texture_index = -1;
 	texture_index = -1;
-	repeat_mode = STRETCH;
 	fit_mode = FILL;
 	fit_mode = FILL;
 	orientation = ROTATE_0;
 	orientation = ROTATE_0;
-
-	position_absolute[0] = false;
-	position_absolute[1] = false;
-	size_absolute[0] = false;
-	size_absolute[1] = false;
 }
 }
 
 
 
 
@@ -83,22 +77,17 @@ void DecoratorTiled::Tile::CalculateDimensions(Element* element, const Texture&
 		else
 		else
 		{
 		{
 			// Need to scale the coordinates to normalized units and 'size' to absolute size (pixels)
 			// Need to scale the coordinates to normalized units and 'size' to absolute size (pixels)
-			for(int i = 0; i < 2; i++)
-			{
-				float size_relative = size[i];
-				new_data.size[i] = Math::AbsoluteValue(size[i]);
-
-				if (size_absolute[i])
-					size_relative /= texture_dimensions[i];
-				else
-					new_data.size[i] *= texture_dimensions[i];
-				
-				new_data.texcoords[0][i] = position[i];
-				if (position_absolute[i])
-					new_data.texcoords[0][i] /= texture_dimensions[i];
-
-				new_data.texcoords[1][i] = size_relative + new_data.texcoords[0][i];
-			}
+			if (size.x == 0 && size.y == 0 && position.x == 0 && position.y == 0)
+				new_data.size = texture_dimensions;
+			else
+				new_data.size = size;
+			
+			Vector2f size_relative = new_data.size / texture_dimensions;
+
+			new_data.size = Vector2f(Math::AbsoluteValue(size.x), Math::AbsoluteValue(size.y));
+
+			new_data.texcoords[0] = position / texture_dimensions;
+			new_data.texcoords[1] = size_relative + new_data.texcoords[0];
 		}
 		}
 
 
 		data.emplace( render_interface, new_data );
 		data.emplace( render_interface, new_data );
@@ -137,73 +126,22 @@ void DecoratorTiled::Tile::GenerateGeometry(std::vector< Vertex >& vertices, std
 
 
 	const TileData& data = data_iterator->second;
 	const TileData& data = data_iterator->second;
 
 
-	int num_tiles[2] = { 0, 0 };
-	Vector2f final_tile_dimensions( 0, 0 );
-
 	// Generate the oriented texture coordinates for the tiles.
 	// Generate the oriented texture coordinates for the tiles.
-	Vector2f scaled_texcoords[3];
+	Vector2f scaled_texcoords[2];
 	for (int i = 0; i < 2; i++)
 	for (int i = 0; i < 2; i++)
 	{
 	{
 		scaled_texcoords[i] = data.texcoords[0] + oriented_texcoords[orientation][i] * (data.texcoords[1] - data.texcoords[0]);
 		scaled_texcoords[i] = data.texcoords[0] + oriented_texcoords[orientation][i] * (data.texcoords[1] - data.texcoords[0]);
 	}
 	}
-	scaled_texcoords[2] = scaled_texcoords[1];
-
-	// Resize the dimensions (if necessary) to fit this tile's repeat mode.
-	for (int i = 0; i < 2; i++)
-	{
-		switch (repeat_mode)
-		{
-		case STRETCH:
-		{
-			// If the tile is stretched, we only need one quad.
-			num_tiles[i] = 1;
-			final_tile_dimensions[i] = surface_dimensions[i];
-		}
-		break;
-
-		case CLAMP_STRETCH:
-		case CLAMP_TRUNCATE:
-		{
-			// If the tile is clamped, we only need one quad if the surface is smaller than the tile, or two if it's larger (to take the last stretched pixel).
-			num_tiles[i] = surface_dimensions[i] > tile_dimensions[i] ? 2 : 1;
-			if (num_tiles[i] == 1)
-			{
-				final_tile_dimensions[i] = surface_dimensions[i];
-				if (repeat_mode == CLAMP_TRUNCATE)
-					scaled_texcoords[1][i] -= (scaled_texcoords[1][i] - scaled_texcoords[0][i]) * (1.0f - (final_tile_dimensions[i] / tile_dimensions[i]));
-			}
-			else
-				final_tile_dimensions[i] = surface_dimensions[i] - tile_dimensions[i];
-		}
-		break;
-
-		case REPEAT_STRETCH:
-		case REPEAT_TRUNCATE:
-		{
-			num_tiles[i] = Math::RealToInteger((surface_dimensions[i] + (tile_dimensions[i] - 1)) / tile_dimensions[i]);
-			num_tiles[i] = Math::Max(0, num_tiles[i]);
-
-			final_tile_dimensions[i] = surface_dimensions[i] - (num_tiles[i] - 1) * tile_dimensions[i];
-			if (final_tile_dimensions[i] <= 0)
-				final_tile_dimensions[i] = tile_dimensions[i];
-
-			if (repeat_mode == REPEAT_TRUNCATE)
-				scaled_texcoords[2][i] -= (scaled_texcoords[1][i] - scaled_texcoords[0][i]) * (1.0f - (final_tile_dimensions[i] / tile_dimensions[i]));
-		}
-		break;
-		}
-	}
-
-
-	// For now, we assume that fit mode and repeat mode cannot both be set on a single tile. The two code paths won't work well together.
-	RMLUI_ASSERT(repeat_mode == STRETCH || fit_mode == FILL);
 
 
+	Vector2f final_tile_dimensions;
 	bool offset_and_clip_tile = false;
 	bool offset_and_clip_tile = false;
 
 
 	switch (fit_mode)
 	switch (fit_mode)
 	{
 	{
 	case FILL:
 	case FILL:
-		// Do nothing, use results from above.
+	{
+		final_tile_dimensions = surface_dimensions;
+	}
 	break;
 	break;
 	case CONTAIN:
 	case CONTAIN:
 	{
 	{
@@ -279,85 +217,22 @@ void DecoratorTiled::Tile::GenerateGeometry(std::vector< Vertex >& vertices, std
 				tile_offset[i] += overshoot_left;
 				tile_offset[i] += overshoot_left;
 			}
 			}
 		}
 		}
-
-		scaled_texcoords[2] = scaled_texcoords[1];
 	}
 	}
 
 
-	// If any of the axes are zero or below, then we have a zero surface area and nothing to render.
-	if (num_tiles[0] <= 0 || num_tiles[1] <= 0)
-		return;
 
 
 	// Resize the vertex and index arrays to fit the new geometry.
 	// Resize the vertex and index arrays to fit the new geometry.
 	int index_offset = (int) vertices.size();
 	int index_offset = (int) vertices.size();
-	vertices.resize(vertices.size() + num_tiles[0] * num_tiles[1] * 4);
+	vertices.resize(vertices.size() + 4);
 	Vertex* new_vertices = &vertices[0] + index_offset;
 	Vertex* new_vertices = &vertices[0] + index_offset;
 
 
 	size_t num_indices = indices.size();
 	size_t num_indices = indices.size();
-	indices.resize(indices.size() + num_tiles[0] * num_tiles[1] * 6);
+	indices.resize(indices.size() + 6);
 	int* new_indices = &indices[0] + num_indices;
 	int* new_indices = &indices[0] + num_indices;
 
 
 	// Generate the vertices for the tiled surface.
 	// Generate the vertices for the tiled surface.
-	for (int y = 0; y < num_tiles[1]; y++)
-	{
-		Vector2f tile_position;
-		tile_position.y = surface_origin.y + (float) tile_dimensions.y * y;
-
-		Vector2f tile_size;
-		tile_size.y = (float) (y < num_tiles[1] - 1 ? data.size.y : final_tile_dimensions.y);
-
-		// Squish the texture coordinates in the y if we're clamping and this is the last in a double-tile.
-		Vector2f tile_texcoords[2];
-		if (num_tiles[1] == 2 &&
-			y == 1 &&
-			(repeat_mode == CLAMP_STRETCH ||
-			 repeat_mode == CLAMP_TRUNCATE))
-		{
-			tile_texcoords[0].y = scaled_texcoords[1].y;
-			tile_texcoords[1].y = scaled_texcoords[1].y;
-		}
-		else
-		{
-			tile_texcoords[0].y = scaled_texcoords[0].y;
-			// The last tile might have truncated texture coords
-			if (y == num_tiles[1] - 1)
-				tile_texcoords[1].y = scaled_texcoords[2].y;
-			else
-				tile_texcoords[1].y = scaled_texcoords[1].y;
-		}
-
-		for (int x = 0; x < num_tiles[0]; x++)
-		{
-			// Squish the texture coordinates in the x if we're clamping and this is the last in a double-tile.
-			if (num_tiles[0] == 2 &&
-				x == 1 &&
-				(repeat_mode == CLAMP_STRETCH ||
-				 repeat_mode == CLAMP_TRUNCATE))
-			{
-				tile_texcoords[0].x = scaled_texcoords[1].x;
-				tile_texcoords[1].x = scaled_texcoords[1].x;
-			}
-			else
-			{
-				tile_texcoords[0].x = scaled_texcoords[0].x;
-				// The last tile might have truncated texture coords
-				if (x == num_tiles[0] - 1)
-					tile_texcoords[1].x = scaled_texcoords[2].x;
-				else
-					tile_texcoords[1].x = scaled_texcoords[1].x;
-			}
-
-			tile_position.x = surface_origin.x + (float) tile_dimensions.x * x;
-			tile_size.x = (float) (x < num_tiles[0] - 1 ? tile_dimensions.x : final_tile_dimensions.x);
+	Vector2f tile_position = (surface_origin + tile_offset).Round();
 
 
-			tile_position = (tile_position + tile_offset).Round();
-			tile_size = tile_size.Round();
-
-			GeometryUtilities::GenerateQuad(new_vertices, new_indices, tile_position, tile_size, quad_colour, tile_texcoords[0], tile_texcoords[1], index_offset);
-			new_vertices += 4;
-			new_indices += 6;
-			index_offset += 4;
-		}
-	}
+	GeometryUtilities::GenerateQuad(new_vertices, new_indices, tile_position, final_tile_dimensions.Round(), quad_colour, scaled_texcoords[0], scaled_texcoords[1], index_offset);
 }
 }
 
 
 // Scales a tile dimensions by a fixed value along one axis.
 // Scales a tile dimensions by a fixed value along one axis.

+ 1 - 18
Source/Core/DecoratorTiled.h

@@ -49,19 +49,6 @@ public:
 	DecoratorTiled();
 	DecoratorTiled();
 	virtual ~DecoratorTiled();
 	virtual ~DecoratorTiled();
 
 
-	/**
-		Stores the repetition mode for a tile, for when it is rendered on a surface that is a
-		different size than itself.
-	 */
-	enum TileRepeatMode
-	{
-		STRETCH = 0,			// Stretches a single tile across the required surface.
-		CLAMP_STRETCH = 1,		// Clamps the tile to the upper left, stretching the tile inwards to fit into the element if it is too small.
-		CLAMP_TRUNCATE = 2,		// Clamps the tile to the upper left, truncating the tile to fit into the element if it is too small.
-		REPEAT_STRETCH = 3,		// Repeats the tile, stretching the final tile inwards.
-		REPEAT_TRUNCATE = 4,	// Repeats the tile, truncating the final tile.
-	};
-
 	/**
 	/**
 		Stores the orientation of a tile.
 		Stores the orientation of a tile.
 	 */
 	 */
@@ -121,15 +108,11 @@ public:
 
 
 		int texture_index;
 		int texture_index;
 
 
-		// Position and size within the texture, absolute or relative units
+		// Position and size within the texture, absolute units (px)
 		Vector2f position, size;
 		Vector2f position, size;
 
 
-		// Absolute is 'px' units, otherwise relative to the dimensions of the texture
-		bool position_absolute[2], size_absolute[2];
-
 		mutable TileDataMap data;
 		mutable TileDataMap data;
 
 
-		TileRepeatMode repeat_mode;
 		TileOrientation orientation;
 		TileOrientation orientation;
 
 
 		TileFitMode fit_mode;
 		TileFitMode fit_mode;

+ 9 - 9
Source/Core/DecoratorTiledBoxInstancer.cpp

@@ -35,17 +35,17 @@ namespace Core {
 
 
 DecoratorTiledBoxInstancer::DecoratorTiledBoxInstancer() : DecoratorTiledInstancer(9)
 DecoratorTiledBoxInstancer::DecoratorTiledBoxInstancer() : DecoratorTiledInstancer(9)
 {
 {
-	RegisterTileProperty("top-left-image", false);
-	RegisterTileProperty("top-right-image", false);
-	RegisterTileProperty("bottom-left-image", false);
-	RegisterTileProperty("bottom-right-image", false);
+	RegisterTileProperty("top-left-image");
+	RegisterTileProperty("top-right-image");
+	RegisterTileProperty("bottom-left-image");
+	RegisterTileProperty("bottom-right-image");
 
 
-	RegisterTileProperty("left-image", true);
-	RegisterTileProperty("right-image", true);
-	RegisterTileProperty("top-image", true);
-	RegisterTileProperty("bottom-image", true);
+	RegisterTileProperty("left-image");
+	RegisterTileProperty("right-image");
+	RegisterTileProperty("top-image");
+	RegisterTileProperty("bottom-image");
 
 
-	RegisterTileProperty("center-image", true);
+	RegisterTileProperty("center-image");
 
 
 	RegisterShorthand("decorator", "top-left-image, top-image, top-right-image, left-image, center-image, right-image, bottom-left-image, bottom-image, bottom-right-image", ShorthandType::RecursiveCommaSeparated);
 	RegisterShorthand("decorator", "top-left-image, top-image, top-right-image, left-image, center-image, right-image, bottom-left-image, bottom-image, bottom-right-image", ShorthandType::RecursiveCommaSeparated);
 }
 }

+ 3 - 3
Source/Core/DecoratorTiledHorizontalInstancer.cpp

@@ -35,9 +35,9 @@ namespace Core {
 
 
 DecoratorTiledHorizontalInstancer::DecoratorTiledHorizontalInstancer() : DecoratorTiledInstancer(3)
 DecoratorTiledHorizontalInstancer::DecoratorTiledHorizontalInstancer() : DecoratorTiledInstancer(3)
 {
 {
-	RegisterTileProperty("left-image", false);
-	RegisterTileProperty("right-image", false);
-	RegisterTileProperty("center-image", true);
+	RegisterTileProperty("left-image");
+	RegisterTileProperty("right-image");
+	RegisterTileProperty("center-image");
 	RegisterShorthand("decorator", "left-image, center-image, right-image", ShorthandType::RecursiveCommaSeparated);
 	RegisterShorthand("decorator", "left-image, center-image, right-image", ShorthandType::RecursiveCommaSeparated);
 }
 }
 
 

+ 1 - 1
Source/Core/DecoratorTiledImageInstancer.cpp

@@ -35,7 +35,7 @@ namespace Core {
 
 
 DecoratorTiledImageInstancer::DecoratorTiledImageInstancer() : DecoratorTiledInstancer(1)
 DecoratorTiledImageInstancer::DecoratorTiledImageInstancer() : DecoratorTiledInstancer(1)
 {
 {
-	RegisterTileProperty("image", false, true);
+	RegisterTileProperty("image", true);
 	RegisterShorthand("decorator", "image", ShorthandType::RecursiveRepeat);
 	RegisterShorthand("decorator", "image", ShorthandType::RecursiveRepeat);
 }
 }
 
 

+ 8 - 54
Source/Core/DecoratorTiledInstancer.cpp

@@ -39,33 +39,14 @@ DecoratorTiledInstancer::DecoratorTiledInstancer(size_t num_tiles)
 }
 }
 
 
 // Adds the property declarations for a tile.
 // Adds the property declarations for a tile.
-void DecoratorTiledInstancer::RegisterTileProperty(const String& name, bool register_repeat_modes, bool register_fit_modes)
+void DecoratorTiledInstancer::RegisterTileProperty(const String& name, bool register_fit_modes)
 {
 {
 	TilePropertyIds ids = {};
 	TilePropertyIds ids = {};
 
 
 	ids.src = RegisterProperty(CreateString(32, "%s-src", name.c_str()), "").AddParser("string").GetId();
 	ids.src = RegisterProperty(CreateString(32, "%s-src", name.c_str()), "").AddParser("string").GetId();
-	ids.x = RegisterProperty(CreateString(32, "%s-x", name.c_str()), "0px").AddParser("number_length_percent").GetId();
-	ids.y = RegisterProperty(CreateString(32, "%s-y", name.c_str()), "0px").AddParser("number_length_percent").GetId();
-	ids.width = RegisterProperty(CreateString(32, "%s-width", name.c_str()), "1.0").AddParser("number_length_percent").GetId();
-	ids.height = RegisterProperty(CreateString(32, "%s-height", name.c_str()), "1.0").AddParser("number_length_percent").GetId();
-	RegisterShorthand(CreateString(32, "%s-pos", name.c_str()), CreateString(64, "%s-x, %s-y", name.c_str(), name.c_str()), ShorthandType::FallThrough);
-	RegisterShorthand(CreateString(32, "%s-size", name.c_str()), CreateString(64, "%s-width, %s-height", name.c_str(), name.c_str()), ShorthandType::FallThrough);
-
-	ids.orientation = RegisterProperty(CreateString(32, "%s-orientation", name.c_str()), "none")
-		.AddParser("keyword", "none, rotate-90, rotate-180, rotate-270, flip-horizontal, flip-vertical")
-		.GetId();
 
 
 	String additional_modes;
 	String additional_modes;
 
 
-	if (register_repeat_modes)
-	{
-		String repeat_name = CreateString(32, "%s-repeat", name.c_str());
-		ids.repeat = RegisterProperty(repeat_name, "stretch")
-			.AddParser("keyword", "stretch, clamp-stretch, clamp-truncate, repeat-stretch, repeat-truncate")
-			.GetId();
-		additional_modes += repeat_name + ", ";
-	}
-
 	if (register_fit_modes)
 	if (register_fit_modes)
 	{
 	{
 		String fit_name = CreateString(32, "%s-fit", name.c_str());
 		String fit_name = CreateString(32, "%s-fit", name.c_str());
@@ -85,10 +66,14 @@ void DecoratorTiledInstancer::RegisterTileProperty(const String& name, bool regi
 			.AddParser("length_percent")
 			.AddParser("length_percent")
 			.GetId();
 			.GetId();
 
 
-		additional_modes += fit_name + ", " + align_x_name + ", " + align_y_name + ", ";
+		additional_modes += ", " + fit_name + ", " + align_x_name + ", " + align_y_name;
 	}
 	}
-	
-	RegisterShorthand(name, CreateString(256, ("%s-src, " + additional_modes + "%s-orientation, %s-x, %s-y, %s-width, %s-height").c_str(),
+
+	ids.orientation = RegisterProperty(CreateString(32, "%s-orientation", name.c_str()), "none")
+		.AddParser("keyword", "none, rotate-90, rotate-180, rotate-270, flip-horizontal, flip-vertical")
+		.GetId();
+
+	RegisterShorthand(name, CreateString(256, ("%s-src, %s-orientation" + additional_modes).c_str(),
 		name.c_str(), name.c_str(), name.c_str(), name.c_str(), name.c_str(), name.c_str()),
 		name.c_str(), name.c_str(), name.c_str(), name.c_str(), name.c_str(), name.c_str()),
 		ShorthandType::FallThrough);
 		ShorthandType::FallThrough);
 
 
@@ -96,23 +81,6 @@ void DecoratorTiledInstancer::RegisterTileProperty(const String& name, bool regi
 }
 }
 
 
 
 
-// Loads a single texture coordinate value from the properties.
-static void LoadTexCoord(const Property& property, float& tex_coord, bool& tex_coord_absolute)
-{
-	tex_coord = property.value.Get< float >();
-	if (property.unit == Property::PX)
-	{
-		tex_coord_absolute = true;
-	}
-	else
-	{
-		tex_coord_absolute = false;
-		if (property.unit == Property::PERCENT)
-			tex_coord *= 0.01f;
-	}
-}
-
-
 // Retrieves all the properties for a tile from the property dictionary.
 // Retrieves all the properties for a tile from the property dictionary.
 bool DecoratorTiledInstancer::GetTileProperties(DecoratorTiled::Tile* tiles, Texture* textures, size_t num_tiles_and_textures, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) const
 bool DecoratorTiledInstancer::GetTileProperties(DecoratorTiled::Tile* tiles, Texture* textures, size_t num_tiles_and_textures, const PropertyDictionary& properties, const DecoratorInstancerInterface& interface) const
 {
 {
@@ -149,18 +117,10 @@ bool DecoratorTiledInstancer::GetTileProperties(DecoratorTiled::Tile* tiles, Tex
 			tile.size.x = sprite->rectangle.width;
 			tile.size.x = sprite->rectangle.width;
 			tile.size.y = sprite->rectangle.height;
 			tile.size.y = sprite->rectangle.height;
 
 
-			tile.position_absolute[0] = tile.position_absolute[1] = true;
-			tile.size_absolute[0] = tile.size_absolute[1] = true;
-
 			texture = sprite->sprite_sheet->texture;
 			texture = sprite->sprite_sheet->texture;
 		}
 		}
 		else
 		else
 		{
 		{
-			LoadTexCoord(*properties.GetProperty(ids.x), tile.position.x, tile.position_absolute[0]);
-			LoadTexCoord(*properties.GetProperty(ids.y), tile.position.y, tile.position_absolute[1]);
-			LoadTexCoord(*properties.GetProperty(ids.width), tile.size.x, tile.size_absolute[0]);
-			LoadTexCoord(*properties.GetProperty(ids.height), tile.size.y, tile.size_absolute[1]);
-
 			// Since the common use case is to specify the same texture for all tiles, we
 			// Since the common use case is to specify the same texture for all tiles, we
 			// check the previous texture first before fetching from the global database.
 			// check the previous texture first before fetching from the global database.
 			if (texture_name == previous_texture_name)
 			if (texture_name == previous_texture_name)
@@ -181,12 +141,6 @@ bool DecoratorTiledInstancer::GetTileProperties(DecoratorTiled::Tile* tiles, Tex
 			}
 			}
 		}
 		}
 
 
-		if(ids.repeat != PropertyId::Invalid)
-		{
-			const Property& repeat_property = *properties.GetProperty(ids.repeat);
-			tile.repeat_mode = (DecoratorTiled::TileRepeatMode)repeat_property.value.Get< int >();
-		}
-
 		if (ids.fit != PropertyId::Invalid)
 		if (ids.fit != PropertyId::Invalid)
 		{
 		{
 			RMLUI_ASSERT(ids.align_x != PropertyId::Invalid && ids.align_y != PropertyId::Invalid);
 			RMLUI_ASSERT(ids.align_x != PropertyId::Invalid && ids.align_y != PropertyId::Invalid);

+ 2 - 3
Source/Core/DecoratorTiledInstancer.h

@@ -50,9 +50,8 @@ public:
 protected:
 protected:
 	/// Adds the property declarations for a tile.
 	/// Adds the property declarations for a tile.
 	/// @param[in] name The name of the tile property.
 	/// @param[in] name The name of the tile property.
-	/// @param[in] register_repeat_modes If true, the tile will have the repeat modes registered.
 	/// @param[in] register_fit_modes If true, the tile will have the fit modes registered.
 	/// @param[in] register_fit_modes If true, the tile will have the fit modes registered.
-	void RegisterTileProperty(const String& name, bool register_repeat_modes, bool register_fit_modes = false);
+	void RegisterTileProperty(const String& name, bool register_fit_modes = false);
 
 
 	/// Retrieves all the properties for a tile from the property dictionary.
 	/// Retrieves all the properties for a tile from the property dictionary.
 	/// @param[out] tile The tile structure for storing the tile properties.
 	/// @param[out] tile The tile structure for storing the tile properties.
@@ -63,7 +62,7 @@ protected:
 
 
 private:
 private:
 	struct TilePropertyIds {
 	struct TilePropertyIds {
-		PropertyId src, repeat, x, y, width, height, orientation, fit, align_x, align_y;
+		PropertyId src, fit, align_x, align_y, orientation;
 	};
 	};
 
 
 	std::vector<TilePropertyIds> tile_property_ids;
 	std::vector<TilePropertyIds> tile_property_ids;

+ 3 - 3
Source/Core/DecoratorTiledVerticalInstancer.cpp

@@ -35,9 +35,9 @@ namespace Core {
 
 
 DecoratorTiledVerticalInstancer::DecoratorTiledVerticalInstancer() : DecoratorTiledInstancer(3)
 DecoratorTiledVerticalInstancer::DecoratorTiledVerticalInstancer() : DecoratorTiledInstancer(3)
 {
 {
-	RegisterTileProperty("top-image", false);
-	RegisterTileProperty("bottom-image", false);
-	RegisterTileProperty("center-image", true);
+	RegisterTileProperty("top-image");
+	RegisterTileProperty("bottom-image");
+	RegisterTileProperty("center-image");
 	RegisterShorthand("decorator", "top-image, center-image, bottom-image", ShorthandType::RecursiveCommaSeparated);
 	RegisterShorthand("decorator", "top-image, center-image, bottom-image", ShorthandType::RecursiveCommaSeparated);
 }
 }