![]() |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi again.
I have been doing some simple gradient-related programming and have run into a super-annoying behavior. This is in X5 for sure (which I use at work) and, I think, in X6 as well. Easy to duplicate: Make a shape, such as a rectangle and give it a gradient fill: ![]() Now run this simple code: Code:
Sub Grablem() With ActiveSelection.Shapes.First.Fill.Fountain .StartX = 0 End With End Sub ![]() It is as if the gradient node is selected. If you click/create other objects you can escape this, but a new problem pops up - I guess internally Corel just really wants to hold on to that gradient node so object size/position updates get thrown out the window - no matter what you pick the Property Toolbar will show the position/size of the last object you actually manipulated. This gets even worse if you deal with effects since in their case the toolbar becomes completely useless. As an added "bonus" this behavior stays with you until you close CD, even in new documents. Does anyone have any idea how to avoid this? |
#2
|
|||
|
|||
![]()
Btw - could someone please just see if they get the same behavior? Otherwise it is unclear whether it's just on my system or has to do with some other code interoperability.
For what it's worth I just tested and it happens in X6 as well. |
#4
|
|||
|
|||
![]()
Yes, the node is moved, but what you see in the second screenshot is what happens - the gradient interface actually shows up and sort-of stays "stuck" on that object. Then even if you click somewhere else and back to that object and, for example, click a color swatch expecting to apply a uniform fill the gradient end node color will be changed instead. In essence you are trapped inside the gradient on that object, something one wouldn't expect, especially from running straight-up VBA code.
As mentioned a side effect of this is that the property bar stops refreshing with object sizes and such when you select (or tab between) objects. I have found a sort-of workaround that helps a bit - adding a S.CreateSelection command to the loop seems to help with the refresh on X6 (but not X5). So basically the problem is staying trapped inside the gradient in a way. I can make a video if necessary showing the problem. |
![]() |
Tags |
bug, gradient, problem, vba |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
macro causing annoying warning box | gorgo | Code Critique | 2 | 21-03-2013 10:26 |
Trapped in GetUserClick - unusual behavior? | Joe | CorelDRAW/Corel DESIGNER VBA | 2 | 24-05-2012 14:09 |
web page glitch | mmacw | General | 1 | 07-11-2008 12:25 |
Gradient + Break Apart | Hernán | New product ideas | 6 | 25-04-2004 15:34 |
Gradient Fill | Michael Cervantes | Corel Photo-Paint VBA | 1 | 08-04-2004 10:05 |