Mercurial > octave
diff libinterp/corefcn/graphics-toolkit.h @ 27254:e3d886685813
Let graphics toolkit compute the extent of uicontrol text strings (bug #48446)
* graphics-toolkit.h (base_graphics_toolkit::get_text_extent,
graphics_toolkit::get_text_extent): New virtual methods.
* Backend.h, Backend.cc (Backend::get_text_extent): Reimplement virtual method.
Compute the extent based on the string property of uicontrol objects.
* graphics.cc (uicontrol::properties::get_text_extent): Use toolkit method
rather than a freetype text renderer.
* genpropdoc.m: Document the uicontrol "extent" property.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Thu, 11 Jul 2019 15:46:18 +0200 |
parents | 00f796120a6d |
children | c23aee2104de |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics-toolkit.h Mon Jul 15 13:04:31 2019 -0700 +++ b/libinterp/corefcn/graphics-toolkit.h Thu Jul 11 15:46:18 2019 +0200 @@ -87,6 +87,12 @@ return Matrix (1, 2, 0.0); } + virtual Matrix get_text_extent (const graphics_object&) const + { + gripe_if_tkit_invalid ("get_text_extent"); + return Matrix (); + } + // Callback function executed when the given graphics object // changes. This allows the graphics toolkit to act on property // changes if needed. @@ -198,6 +204,9 @@ Matrix get_screen_size (void) const { return rep->get_screen_size (); } + Matrix get_text_extent (const graphics_object& go) const + { return rep->get_text_extent (go); } + // Notifies graphics toolkit that object't property has changed. void update (const graphics_object& go, int id) { rep->update (go, id); }