View Issue Details

IDProjectCategoryView StatusLast Update
0012576ScribusCanvaspublic2016-12-08 22:04
Reporterale Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionreopened 
Product Version1.5.0 
Target Version1.5.4Fixed in Version1.5.0svn 
Summary0012576: limit the "size" of dropped vectors
Descriptionseems to be working, now.
(well, groups are normal items... and vectors imported are grouped)

duplicated code with the image one... but i could not find a good way / place to put a more general method that would resize the item.

as the other patch, it limits the size of the imported vector to the size of the page.
Tagspatch
Attached Files
scribusview_vector.diff (1,198 bytes)   
Index: scribus/scribusview.cpp
===================================================================
--- scribus/scribusview.cpp	(revision 19357)
+++ scribus/scribusview.cpp	(working copy)
@@ -915,6 +933,34 @@
 								undoManager->setUndoEnabled(false);
 								Doc->dontResize = true;
 								fmt->loadFile(url.toLocalFile(), LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
+
+								PageItem *pageItem = Doc->m_Selection->itemAt(0);
+								ScPage *page = Doc->currentPage();
+
+								double iw = static_cast<double>(pageItem->width() * 72.0 / pageItem->pixm.imgInfo.xres);
+								double ih = static_cast<double>(pageItem->height() * 72.0 / pageItem->pixm.imgInfo.xres);
+								if (iw > ih) {
+									double pw = page->width();
+									if (iw > pw) {
+										ih = pw / (iw / ih);
+										iw = pw;
+									}
+								} else {
+									double ph = page->height();
+									if (ih > ph) {
+										iw = ph / (ih / iw);
+										ih = ph;
+									}
+								}
+								pageItem->setWidth(iw);
+								pageItem->setHeight(ih);
+
 								undoManager->setUndoEnabled(true);
 								if (Doc->m_Selection->count() > 0)
 								{
scribusview_vector.diff (1,198 bytes)   
PatchYes

Relationships

has duplicate 0007707 closed [Proposal] Trigger a dialog for dropped images (mockup included) 
has duplicate 0004724 closed Option to determine the size of a vector drawing at import time 
has duplicate 0010995 new Enable click and drag when importing a vector file (+ ability to set a specific size) 
related to 0012558 closedcbradney [PATCH] limit the "size" of dropped images 

Activities

ale

2014-07-30 19:59

manager   ~0033090

if this patch is accepted, i would suggest to close 0007707

Kunda

2014-07-30 20:02

updater   ~0033091

Last edited: 2014-07-31 05:24

+1 on committing patch if it works
+1 on closing 0007707
and
+1 on closing duplicate 0010995
and most likely also 0004724 (or perhaps not)

cbradney

2014-07-31 20:20

administrator   ~0033118

The patch doesn't deal properly with the bounding box resizing. Need some help from Jean for correcting this.

Kunda

2014-08-08 19:17

updater   ~0033212

Reminder sent to: jghali

jghali, Craig was asking for assistance on this.

christoph_s

2014-09-04 05:02

developer   ~0033484

While the feature added by the patch is wonderful, it creates an inconsistency in the UI: It's available in the file dialog for "Paste File", but not in "File > Import".

Kunda

2014-09-14 12:43

updater   ~0033686

Last edited: 2014-09-14 12:51

What is remaining on this topic is:
* Christoph's above comment in (0012576:0033484)
* From 0004724 : "It would be useful if the user could determine x and y size at import time."
* From 0010995 : "click and drag when importing a vector file to set its size (with size constraint in the selection or at least in the result).
shift-click should behave in the same way as for the frames (fill the margins or the surrounding guides)"
* 0007707 contains mockups of the dialog if in future we want to add one or a hint bubble (see 0012598)

christoph_s

2014-09-14 20:05

developer   ~0033695

The option is also missing in the Picture Browser.

cbradney

2014-10-29 21:17

administrator   ~0034173

This cannot be applied until the patch handles bounding box sizing correctly. We'll see if we can sort that.. feel free to sort and resubmit

Kunda

2014-10-30 13:26

updater   ~0034175

Last edited: 2014-10-30 13:26

Will just bump this to 1.5.1 so that we can focus more on 1.5 blockers

Kunda

2015-06-05 20:36

updater   ~0035327

Summarizing issues that need to be addressed in order to implement patch:
* it creates an inconsistency in the UI: It's available in the file dialog for "Paste File", but not in "File > Import".
* option is also missing in the Picture Browser.
* cannot be applied until the patch handles bounding box sizing correctly.

Issue History

Date Modified Username Field Change
2014-07-30 19:57 ale New Issue
2014-07-30 19:57 ale Status new => assigned
2014-07-30 19:57 ale Assigned To => ale
2014-07-30 19:57 ale File Added: scribusview_vector.diff
2014-07-30 19:57 ale Relationship added related to 0007707
2014-07-30 19:58 ale Tag Attached: patch
2014-07-30 19:59 ale Note Added: 0033090
2014-07-30 20:02 Kunda Note Added: 0033091
2014-07-30 20:04 Kunda Note Edited: 0033091
2014-07-30 20:04 Kunda Relationship added has duplicate 0010995
2014-07-30 20:15 Kunda Relationship added related to 0004724
2014-07-30 20:17 Kunda Note Edited: 0033091
2014-07-31 05:24 Kunda Note Edited: 0033091
2014-07-31 08:42 ale Relationship deleted has duplicate 0010995
2014-07-31 20:20 cbradney Note Added: 0033118
2014-08-08 19:17 Kunda Note Added: 0033212
2014-08-18 20:14 Kunda Relationship added related to 0012558
2014-08-19 08:31 fschmid Status assigned => resolved
2014-08-19 08:31 fschmid Fixed in Version => 1.5.0svn
2014-08-19 08:31 fschmid Resolution open => fixed
2014-09-04 05:02 christoph_s Assigned To ale => fschmid
2014-09-04 05:02 christoph_s Note Added: 0033484
2014-09-04 05:02 christoph_s Status resolved => feedback
2014-09-04 05:02 christoph_s Resolution fixed => reopened
2014-09-14 12:43 Kunda Note Added: 0033686
2014-09-14 12:45 Kunda Relationship added has duplicate 0010995
2014-09-14 12:51 Kunda Note Edited: 0033686
2014-09-14 12:52 Kunda Relationship replaced has duplicate 0007707
2014-09-14 12:55 Kunda Relationship replaced has duplicate 0004724
2014-09-14 20:05 christoph_s Note Added: 0033695
2014-10-24 22:57 Kunda Patch => Yes
2014-10-29 01:37 Kunda Sticky Issue No => Yes
2014-10-29 21:17 cbradney Note Added: 0034173
2014-10-30 13:26 Kunda Note Added: 0034175
2014-10-30 13:26 Kunda Target Version => 1.5.1svn
2014-10-30 13:26 Kunda Note Edited: 0034175
2014-10-30 13:26 Kunda Sticky Issue Yes => No
2015-01-22 23:27 cbradney Target Version 1.5.1svn => 1.5.1
2015-02-13 10:35 ale Assigned To fschmid =>
2015-02-13 10:35 ale Status feedback => new
2015-02-13 10:45 ale Summary [PATCH] limit the "size" of dropped vectors => limit the "size" of dropped vectors
2015-06-05 20:36 Kunda Note Added: 0035327
2016-01-23 17:16 cbradney Target Version 1.5.1 => 1.5.3
2016-12-08 22:04 Kunda Target Version 1.5.3 => 1.5.4