# HG changeset patch # User Pantxo Diribarne # Date 1414784661 -3600 # Fri Oct 31 20:44:21 2014 +0100 # Node ID 325d3cfdcde53528e6d32487c515dadc89455641 # Parent e1713e281ac540f4cee71be966a59e2decb795d0 Make "image ()" use the default image cdata * graphics.in.h (image::properties::initialize_data): new public method to trigger the initialization of the x/ydata properties. * graphics.in.h (image::image): call initialize_data. * image.m: when called with no argument, use default image cdata diff -r e1713e281ac5 -r 325d3cfdcde5 libinterp/corefcn/graphics.in.h --- a/libinterp/corefcn/graphics.in.h Tue Oct 07 21:11:17 2014 +0200 +++ b/libinterp/corefcn/graphics.in.h Fri Oct 31 20:44:21 2014 +0100 @@ -4583,6 +4583,8 @@ octave_value get_color_data (void) const; + void initialize_data (void) { update_cdata (); } + // See the genprops.awk script for an explanation of the // properties declarations. // Programming note: Keep property list sorted if new ones are added. @@ -4750,6 +4752,7 @@ : base_graphics_object (), xproperties (mh, p) { xproperties.override_defaults (*this); + xproperties.initialize_data (); } ~image (void) { } diff -r e1713e281ac5 -r 325d3cfdcde5 scripts/image/image.m --- a/scripts/image/image.m Tue Oct 07 21:11:17 2014 +0200 +++ b/scripts/image/image.m Fri Oct 31 20:44:21 2014 +0100 @@ -69,7 +69,7 @@ do_new = true; if (nargin == 0) - img = imread ("default.img"); + img = get (0, "defaultimagecdata"); x = y = []; elseif (chararg == 1) ## Low-Level syntax