lib/glimmer/swt/custom/shape/line.rb in glimmer-dsl-swt-4.18.6.1 vs lib/glimmer/swt/custom/shape/line.rb in glimmer-dsl-swt-4.18.6.2

- old
+ new

@@ -1,6 +1,7 @@ # Copyright (c) 2007-2021 Andy Maleh +# Copyright (c) 2007-2021 Andy Maleh # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, @@ -155,18 +156,19 @@ 2 end def path_segment_geometry_args # TODO make args auto-infer first point if previous_point_connected is true or if there is only x1,y1 or x2,y2 (but not both), or if there is an x, y, or if there is a point_array with 1 point - @args[0..1] + @args end def previous_point_connected? @args.compact.count == 2 && !first_path_segment? end def eql?(other) - x1 == (other && other.respond_to?(:x1) && other.x1) && + other.is_a?(Line) && + x1 == (other && other.respond_to?(:x1) && other.x1) && y1 == (other && other.respond_to?(:y1) && other.y1) && x2 == (other && other.respond_to?(:x2) && other.x2) && y2 == (other && other.respond_to?(:y2) && other.y2) end alias == eql?