I'm using perPixelTargetFind: true in combination with targetFindTolerance: 15 to allow users to select lines on canvas by clicking on the line as opposed to the full bounding box that is the default in Fabric.
This works great when a line is drawn at an angle as selecting is easy and the user doesn't have to be too specific with where they click. However, when the line is drawn either perfectly horizontally or vertically the line becomes almost impossible to select, almost like the targetFindTolerance value decreases to 0 depending on the angle of the line.
Here is a simplified example.
You'll notice the cursor change when you are able to select a line, and after selecting the line will change to red.
How about giving padding:value to object.
Here is updated codepen
Related
I need a vertical slider similar the standard slider. Is there a way to modify the existing one or do I need to make a new one?
The standard slider would work for me. I just need it to work vertically.
Perhaps I should better clarify my issue with the standard slider.
Yes, I can drag the size of the slider and it will be vertical. The problem is that when you select the value of the slider to show the text gets buried in the low side of the slider when you slide it down all the way. It essentially gets cut off and only shows the top half of the slider value character. I find no way to correct this by moving the shown text up a little so it all shows. I see no way to change text vertical or offset position in the properties setting.
The text settings only allow you to change the text format to right, center and left justify. There is no setting that can move the text up to prevent it from being cut off when the slider is all the way to the lower or down position.
The value text shows ok on the top of the slider. The problem is on the bottom side when you set the slider to be vertical.
It looks like the the show value setting does not place the value on the top layer of the slider and it gets hidden behind something else in the slider object.
LC9, Windows 10
I think I'm understanding your question. If you just resize the horizontal slider control so that the width is narrower than the height, the orientation of the slider control will automatically change to vertical.
Apparently it is a bug in this version of LC. At least in Win which is where I am testing.
Putting the scrollbar vertically cuts the value when it reaches the bottom.
But I found a solution so that it does not cut. Play around with the properties of the font. Such as size and family. In my case it worked fine by lowering the font size by one pixel.
Default: Segoe UI font, size 12
I just set the size to 11 and it doesn't cut anymore.
For what it is worth, I do not see this issue on a Mac. A vertical slider works as advertised. Font size makes no difference.
Are you saying that in the horizontal mode, you do not see this, but when changed to vertical, you do?
Try creating a scrollbar and a text field.
Set the scrollbar's showValue property to false and copy the following script to your scrollbar. Note that your field must be called "scroll value".
on scrollbarDrag pNewPosition
local tLoc
lock screen
# The Current Loc of Field
put the loc of field "scroll value" into tLoc
# New Position of scrollbar
put pNewPosition into field "scroll value"
# New Loc of Field
put the mouseV into the item 2 of tLoc
set the loc of field "scroll value" to tLoc
set the left of field "scroll value" to the right of me
unlock screen
end scrollbarDrag
I have a scrolled window in my application, in which I have created a drawing area widget. In the drawing area, I have placed multiple images. When the user enters information about an image in a search box, the appropriate image gets highlighted.
My problem is how do I get the application to scroll automatically to the highlighted Image box without the user using the scroll bar. The scrolledwindow should automatically move the view region, to display the region where the highlighted Image is present.
The scrolling policy used on the scrolled window is XmAUTOMATIC.
Any pointers would be greatly appreciated.Thanks in advance.
Try XmScrollVisible() if this does not work then you will need to:
1. Find out the size of the work area.
2. Find out the size and position of the clip window.
3. Find out the max/ min values for the horizontal scrollbar.
4. Use XmScrollBarGetValues() for the horizontal scrollbar to get its position within the max/min values.
5. Do some math magic to determine how much to move the horizontal scrollbar to get the work area to show through the clip window.
6. Call XmScrollBarSetValues() with Notify = True.
7. Repeat for the Vertical scrollbar.
HTH
I Have created a bar chart in a 2007 .xls file, but the data labels cannot be resized. When you go to the "format Data Labels" and then click on alignment, the Autofit and Internal Margin option is grayed out. Anyone know why?
Short version: It is greyed out for chart text, because it the option doesn’t apply.
Long version:
This is because on a chart, chart text do need to use margins, rather you can you can just move the text., and set its X and Y position. For example take the Chart Title, if you want more space to the left, just click and drag the title to the right. If you want the chart title to be bigger you just set a larger font, you have complete control over the title, as well as all other text on that chart, axis titles, legends, data labels, etc.
Internal margins are meant to be used when you don’t have complete control take for example text in a shape. If you insert a shape in your workbook, and add text to it, you cannot just pick the text up and move it to the right if you want more space on the left, so you can set the margin.
Here's a trick that worked for me:
My problem was: I added more text to the axis title and it was too long for it's original shape so some text went into second line.
My solution: I type the complete text somewhere else, copy the text, double click on the axis title and delete the original text -- the cursor would still be there -- now insert the copied text. Done! They are all in one line!
Partial solution to resize label to a single line: Data labels in a chart will often wrap themselves, when you dont want them to. They would often seem better in a vertical single line above the graph item. Reset them to one single line by editing the text in the label, deleting the Excel imposed return, and replace it with a space. The line, and label box, will resize to fit a single line. However because you have "manually interfered with the lable, it will no longer update for changing graph data. You would have to double click each lable then reset it. Most annoying.
A way around it is to make the chart area big. The data label boxes will resize to fit the words in one line. Then make the chart small (not the chart area).
Manually insert a textbox into the bar chart and type in the label that way. It's annoying and labor-intensive, but it works.
E.g.,
http://img862.imageshack.us/img862/931/73853515.png
The border below the text is too long to the left by a few points (the dotted line is just for illustration).
Many thanks!
[Note: I have also posted this question into Mircosoft Answers, but I am not sure how active that site is...]
If you want to do this in Microsoft Word (which is what I assume from the tags) you can put TEST in a table (i.e. in a single cell), enable only the bottom border (at which point you will have the situation you have above, where the black bottom border does not align with T).
In order to make the bottom border align with the T, right-click the table and go to Table Properties > Table > Options and set the Left 'Default Cell Margin' to 0cm.
I'd like to automatically pad my shapes with some space so that connectors (e.g. arrows) do not touch the shape, but instead are a few pixels away.
This can be achieved by moving the shape connector points away from the shape, but this is a manual, time consuming process which needs to be done per shape which I would like to avoid.
How can I automatically insert a fixed amount of space between connectors and shapes?
You can do this with a Custom Line End.
If the Drawing Explorer Window is not shown then View Menu > Drawing Explorer Window.
In the Drawing Explorer Window right click on the Line Ends folder.
Click New Pattern.
Give the Line End a name and select Scaled. Click OK.
Right click on the new Line End.
Click on Edit Pattern Shape.
Draw a small line end e.g. an arrow about 0.125 in square or 3 mm square. The arrow should point to the right.
If there line end you created is made of more than one shape group it, e.g. Ctrl+A then Ctrl+G.
Zoom in closely to the shape.
Make sure the Pointer Tool is selected in the Standard Toolbar.
Select the shape.
Mouse over the Shape Rotation Handle e.g. the lollypop.
A new handle should appear with the tooltip Center of Rotation.
Move this handle outside the shape to the right. How far you move will control the offset of your line from the shapes. See image:
Close the Pattern Shape window.
Click Yes to save the pattern.
Select all the lines you want to use the new Line Pattern with.
Format Menu > Line
Change the Line ends: Begin and Line ends: End to the name of your new Line End. The name will be at the bottom of the list.
The lines begin and ends should now appear offset from the shapes they are connected to.
These instructions are for versions of Visio prior to Visio 2010. In Visio 2010 the menu items described are replace with buttons in the ribbon.