https://bugs.documentfoundation.org/show_bug.cgi?id=100596
--- Comment #6 from Bill <mattison.computer@yahoo.com> ---
(In reply to Regina Henschel from comment #4)
Created attachment 126078 [details]
Basic macro for setting arc and radius numerically
I have attached a document, which contains a Basic library
'BlockArrowEditor'. For a block arc use the subroutine 'EditBlockArc' from
module 'Arc', for a circular arrow (which is very similar) use the
subroutine 'EditCirculaArrow' from module 'Arrow'. To get the macros to your
environment, open the file, then with organizer for Basic export the library
and then import it to 'My Macros' for example.
The solution has a dialog to set the angles in degree. And it has an input
field to enter a factor for the inner radius.
The path of a custom shape is first drawn on a base square of 21600 internal
units. Then it is scaled to the size, which you set in the Position&Size
dialog. And other transformations like flipping, rotating, or shearing might
be applied in addition. But the values from the handles are directly used
in the path calculation. Therefore it is not easily possible the make a
dialog, which refers to the shape as you see it on screen. It would need
some matrix operations. (I have currently not the time to do it.)
Therefore I have created the dialog so, that you specify the inner radius by
a factor. If the untransformed shape has a width of 4cm, then the outer
radius is 4cm. If you then want an inner radius of 3cm, you have to enter
the factor 0.75, because 3cm = 0.75 * 4cm.
The angles always refer to a square shape, their value is in degrees.
I know it is not perfect, but it might help you until someone will implement
a solution.
For implementation I would prefer a more general solution. The Position&Size
dialog should get a new tab page "Custom Shape Adjudgment", which is shown
in case a selected custom shape has handles. So not a special solution for a
block arc, but a general solution for all custom shapes having handles.
In the longer term, I also am wanting a more general solution. But I thought
it easier and wiser to do one shape first. Once that is working well, the
others should be easier. In the long term, I'm looking for:
* circular arcs created/edited by the user by entering in a GUI the center, the
radius, the start angle, and either the central angle or the end angle.
* elliptical arcs created/edited by the user by entering in a GUI the center,
the semi-major and semi-minor axes, the angle of rotation for the semi-major
axis, the start angle, and either the central angle or the end angle.
* circles created/edited by the user by entering in a GUI the center and the
radius.
* ellipses created/edited by the user by entering in a GUI the center, the
semi-major and semi-minor axes, and the angle of rotation for the semi-major
axis.
* rectangles created/edited by the user by entering in a GUI the center, the
length, the width, and the angle of rotation.
* squares created/edited by the user by entering the center, the length of a
side, and the angle of rotation.
* regular polygons created/edited by the user by entering the center, the
number of sides (or vertices), the distance from the center to either a vertex
or the mid-point of a side, and the angle of rotation. (A square could be a
special case of this.)
* stars created/edited by the user by entering the center, the number of
points, the distance from the center to an inner point, the distance from the
center to an outer point, and the angle of rotation.
Other shapes can be done appropriately. The behavior I'm wanting is that when
I want to create a new instance of a shape, I click the shape in the window
area to the left of the document and its ruler, the GUI for me to enter the
appropriate numbers would by default pop up. I would not do any clicking or
dragging in the document. Likewise, to edit an instance of a shape, I click
that shape in the document, and then use the right mouse button to bring up the
floating menu, and from there select the GUI for editing the shape instance.
Again, I would not do any dragging in the document. I should be able to change
a preference value to choose between number entry and clicking/dragging to
create/edit shape instances.
Thank-you for the attachment. I'll give it a try, but I've never tried using
macros before, so this will take some time.
--
You are receiving this mail because:
You are on the CC list for the bug.
Context
- [Libreoffice-ux-advise] [Bug 100596] Would like to be able to create and edit block arcs numerically. · bugzilla-daemon
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.