Commit 49fe9607 authored by Eric Tobias's avatar Eric Tobias

Fixed a bug in Point on the add method

parent ca1b3ee2
......@@ -13,6 +13,10 @@ Implementation of XML based bootstrapping for widgets and coronas.
+ Added ValueProvider interface.
-- Bugfixes --
+ Corrected an issue in Point where a call to add would not corretly clone the returned point and return a copy of the point instance if the parameter for the addition was null. This introduced unexpected behaviour of coronas if the value of the additionw as modified such as in the TextBox.
2.1.4
......
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src">
<classpathentry kind="src" path="config"/>
<classpathentry excluding="main/java/|test/java/" kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="config"/>
<classpathentry kind="src" output="target/test-classes" path="test">
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
......
......@@ -15,6 +15,7 @@ CURSORS_NODE=cursors
DEFINING_SHAPE_NODE=definingShape
DRAW_BORDER_NODE=drawBorder
DRAW_PRIORITY_NODE=drawPriority
DYNAMIC_NODE=variableIsDynamic
EDGE_COLOUR_NODE=edgeColour
EMPTY_STRING=
FILL_COLOUR_NODE=fillColour
......
......@@ -45,6 +45,7 @@ public class Externalization extends NLS {
public static String DEFINING_SHAPE_NODE;
public static String DRAW_BORDER_NODE;
public static String DRAW_PRIORITY_NODE;
public static String DYNAMIC_NODE;
public static String EDGE_COLOUR_NODE;
public static String EMPTY_STRING;
public static String FILL_COLOUR_NODE;
......
......@@ -37,7 +37,7 @@ import java.util.logging.Logger;
*
* @author Eric Tobias [eric.tobias@list.lu]
* @since 1.0
* @version 2.2.0
* @version 2.2.1
*/
@NonNullByDefault
public class Point extends Float {
......@@ -324,7 +324,7 @@ public class Point extends Float {
*/
public Point add(@Nullable Point point) {
if (point == null) {
return this;
return clone();
}
switch (state.getClass().getSimpleName()) {
......
......@@ -73,12 +73,14 @@ public class TextBox extends Corona implements ContextEventListener, Information
*/
@Override
public void paint(Graphics2D canvas) {
if (!active)
if (!active) {
return;
}
centre.toScreenCoordinates();
if (initialTranslation != null)
if (initialTranslation != null) {
initialTranslation.toScreenCoordinates();
}
Point drawAt = centre.add(initialTranslation);
......
......@@ -130,7 +130,7 @@ public abstract class CoronaBuilder<B extends CoronaBuilder<B>> {
Element spinOnCoronaCentreNode = rootElement.getChild(Externalization.SPIN_ON_CORONA_CENTRE_NODE);
if (null != spinOnCoronaCentreNode) {
rotateWithHandle = Boolean.parseBoolean(spinOnCoronaCentreNode.getText());
spinOnCoronaCentre = Boolean.parseBoolean(spinOnCoronaCentreNode.getText());
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment